summaryrefslogtreecommitdiff
path: root/Test.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-08-22 10:29:50 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-08-22 10:29:50 -0400
commitf7940faaa3ce2b45222f4a58406f00d21a996b35 (patch)
tree37735fe618b565bc6ac31702d41057a9269b609a /Test.hs
parentf05916f1df6c2117009f9fe1b8a1236ed364d669 (diff)
add test case for unused with unstaged link
Diffstat (limited to 'Test.hs')
-rw-r--r--Test.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/Test.hs b/Test.hs
index ef3f4e975..985c561be 100644
--- a/Test.hs
+++ b/Test.hs
@@ -587,6 +587,17 @@ test_unused env = "git-annex unused/dropunused" ~: intmpclonerepoInDirect env $
checkunused [] "after dropunused"
not <$> git_annex env "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
+ writeFile "unusedfile" "unusedcontent"
+ git_annex env "add" ["unusedfile"] @? "add of unusedfile failed"
+ unusedfilekey <- annexeval $ findkey "unusedfile"
+ renameFile "unusedfile" "unusedunstagedfile"
+ boolSystem "git" [Params "rm -qf", File "unusedfile"] @? "git rm failed"
+ checkunused [] "with unstaged link"
+ removeFile "unusedunstagedfile"
+ checkunused [unusedfilekey] "with unstaged link deleted"
+
where
checkunused expectedkeys desc = do
git_annex env "unused" [] @? "unused failed"