From 2e8389360c1180cc85547e0d555cabdd3813980c Mon Sep 17 00:00:00 2001 From: guilhem Date: Mon, 26 Aug 2013 19:01:48 +0200 Subject: Unused: bugfix Detect staged files that are not in the working tree. --- Test.hs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Test.hs') 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" -- cgit v1.2.3