summaryrefslogtreecommitdiff
path: root/Test.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-30 14:23:31 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-30 14:23:31 -0400
commit97f6b63c1cc2c6e03849edde9995135270a520a8 (patch)
treef4bc77bd288b9b1cac586939c9720dc7bca72ede /Test.hs
parent2b8e7b4041a4fa47caaf3507317c5b96f6f3e9e4 (diff)
fix failing git-annex unused test case in v6
WorkTree.lookupFile was finding a key for a file that's deleted from the work tree, which is different than the v5 behavior (though perhaps the same as the direct mode behavior). Fix by checking that the work tree file exists before catting its key. Hopefully this won't slow down much, probably the catKey is much more expensive. I can't see any way to optimise this, except perhaps to make Command.Unused check if work tree files exist before/after calling lookupFile. But, it seems better to make lookupFile really only find keys for worktree files; that's what it's intended to do.
Diffstat (limited to 'Test.hs')
-rw-r--r--Test.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Test.hs b/Test.hs
index 2d22735f7..643969440 100644
--- a/Test.hs
+++ b/Test.hs
@@ -123,7 +123,7 @@ tests = testGroup "Tests" $ properties :
map (\(d, te) -> withTestMode te (unitTests d)) testmodes
where
testmodes =
- --[ ("v6", TestMode { forceDirect = False, annexVersion = "6" })
+ -- [ ("v6", TestMode { forceDirect = False, annexVersion = "6" })
[ ("v5", TestMode { forceDirect = False, annexVersion = "5" })
-- Windows will only use direct mode, so don't test twice.
#ifndef mingw32_HOST_OS
@@ -798,8 +798,8 @@ test_unused = intmpclonerepoInDirect $ do
checkunused [] "after dropunused"
not <$> git_annex "dropunused" ["--force", "10", "501"] @? "dropunused failed to fail on bogus numbers"
- -- unused used to miss symlinks that were not staged and pointed
- -- at annexed content, and think that content was unused
+ -- unused used to miss renamed symlinks that were not staged
+ -- and pointed at annexed content, and think that content was unused
writeFile "unusedfile" "unusedcontent"
git_annex "add" ["unusedfile"] @? "add of unusedfile failed"
unusedfilekey <- annexeval $ findkey "unusedfile"
@@ -807,7 +807,7 @@ test_unused = intmpclonerepoInDirect $ do
boolSystem "git" [Param "rm", Param "-qf", File "unusedfile"] @? "git rm failed"
checkunused [] "with unstaged link"
removeFile "unusedunstagedfile"
- checkunused [unusedfilekey] "with unstaged link deleted"
+ checkunused [unusedfilekey] "with renamed link deleted"
-- unused used to miss symlinks that were deleted or modified
-- manually, but commited as such.