summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-07-18 13:30:12 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-07-18 13:30:12 -0400
commitfe0dbbabc3208c79eab8390e2789ea2fc2e02981 (patch)
tree22e5a6239ff90670b5faa3d3c8f61f218a897374 /Annex
parent328e54d9cc3daec662ad6129bf90ef298887b10d (diff)
fix uninit to delete content from annex when it ended up hard linked back to the work tree
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Content.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index b0e0643d7..96f9d78fc 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -1,6 +1,6 @@
{- git-annex file content managing
-
- - Copyright 2010,2012 Joey Hess <joey@kitenet.net>
+ - Copyright 2010-2013 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
@@ -10,6 +10,7 @@
module Annex.Content (
inAnnex,
inAnnexSafe,
+ inAnnexCheck,
lockContent,
getViaTmp,
getViaTmpChecked,
@@ -56,7 +57,11 @@ import Annex.ReplaceFile
{- Checks if a given key's content is currently present. -}
inAnnex :: Key -> Annex Bool
-inAnnex = inAnnex' id False $ liftIO . doesFileExist
+inAnnex key = inAnnexCheck key $ liftIO . doesFileExist
+
+{- Runs an arbitrary check on a key's content. -}
+inAnnexCheck :: Key -> (FilePath -> Annex Bool) -> Annex Bool
+inAnnexCheck key check = inAnnex' id False check key
{- Generic inAnnex, handling both indirect and direct mode.
-