diff options
author | 2013-08-26 19:01:48 +0200 | |
---|---|---|
committer | 2013-08-26 13:50:09 -0400 | |
commit | 2e8389360c1180cc85547e0d555cabdd3813980c (patch) | |
tree | ef1deecc31cae8db3b8925e198c770607e79ee75 /Test.hs | |
parent | 499a3e6da79d752dab0b4c62c0f0e17db82aa2d6 (diff) |
Unused: bugfix
Detect staged files that are not in the working tree.
Diffstat (limited to 'Test.hs')
-rw-r--r-- | Test.hs | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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" |