aboutsummaryrefslogtreecommitdiff
path: root/Command/Unused.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-03-14 13:13:56 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-03-14 13:14:01 -0400
commit589d8a9207aaf72e3562ca8ff7cf339d8dd97fa8 (patch)
tree489ba242f823a954e1dbfc3221c79b0a76e3bc12 /Command/Unused.hs
parentaeee4a4b7093358d4cc664146e61329bfd67956b (diff)
Correct git-annex info to include unlocked files in v6 repository.
An unlocked present file does not have a pointer file in the worktree, so info skipped counting it. It may be that unused was also affected by the problem, but it seemed not to be in my tests. I think because of the use of the associatedFilesFilter. This fix slows down both info and unused a little bit, since they have to query the contents of files from git, but only when handling unlocked files.
Diffstat (limited to 'Command/Unused.hs')
-rw-r--r--Command/Unused.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs
index b6f3e93b6..8040dc21a 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -27,6 +27,7 @@ import qualified Remote
import qualified Annex.Branch
import Annex.Link
import Annex.CatFile
+import Annex.WorkTree
import Types.RefSpec
import Git.Types
import Git.Sha
@@ -215,10 +216,7 @@ withKeysReferenced' mdir initial a = do
Just dir -> inRepo $ LsFiles.inRepo [dir]
go v [] = return v
go v (f:fs) = do
- mk <- getM id
- [ isAnnexLink f
- , liftIO (isPointerFile f)
- ]
+ mk <- lookupFile f
case mk of
Nothing -> go v fs
Just k -> do