summaryrefslogtreecommitdiff
path: root/Test.hs
diff options
context:
space:
mode:
authorGravatar guilhem <guilhem@fripost.org>2013-08-26 19:01:48 +0200
committerGravatar Joey Hess <joey@kitenet.net>2013-08-26 13:50:09 -0400
commit2e8389360c1180cc85547e0d555cabdd3813980c (patch)
treeef1deecc31cae8db3b8925e198c770607e79ee75 /Test.hs
parent499a3e6da79d752dab0b4c62c0f0e17db82aa2d6 (diff)
Unused: bugfix
Detect staged files that are not in the working tree.
Diffstat (limited to 'Test.hs')
-rw-r--r--Test.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/Test.hs b/Test.hs
index 985c561be..3eb330c22 100644
--- a/Test.hs
+++ b/Test.hs
@@ -598,6 +598,26 @@ test_unused env = "git-annex unused/dropunused" ~: intmpclonerepoInDirect env $
removeFile "unusedunstagedfile"
checkunused [unusedfilekey] "with unstaged link deleted"
+ -- unused used to miss symlinks that were deleted or modified
+ -- manually, but commited as such.
+ writeFile "unusedfile" "unusedcontent"
+ git_annex env "add" ["unusedfile"] @? "add of unusedfile failed"
+ boolSystem "git" [Param "add", File "unusedfile"] @? "git add failed"
+ unusedfilekey' <- annexeval $ findkey "unusedfile"
+ checkunused [] "with staged deleted link"
+ boolSystem "git" [Params "rm -qf", File "unusedfile"] @? "git rm failed"
+ checkunused [unusedfilekey'] "with staged link deleted"
+
+ -- unused used to miss symlinks that were deleted or modified
+ -- manually, but not staged as such.
+ writeFile "unusedfile" "unusedcontent"
+ git_annex env "add" ["unusedfile"] @? "add of unusedfile failed"
+ boolSystem "git" [Param "add", File "unusedfile"] @? "git add failed"
+ unusedfilekey'' <- annexeval $ findkey "unusedfile"
+ checkunused [] "with unstaged deleted link"
+ removeFile "unusedfile"
+ checkunused [unusedfilekey''] "with unstaged link deleted"
+
where
checkunused expectedkeys desc = do
git_annex env "unused" [] @? "unused failed"