summaryrefslogtreecommitdiff
path: root/test.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-01-13 23:46:02 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-01-13 23:46:02 -0400
commitc1839fdccb286cb5e83f0cf2d1d2d8e15226b0eb (patch)
tree7931bec9800f08ef61f52cb52feae10968d2fa0a /test.hs
parent23686cc63d38faf7fb4d66ece8cbeb5214b07e5f (diff)
unlock: Fix behavior when file content is not present.
Diffstat (limited to 'test.hs')
-rw-r--r--test.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/test.hs b/test.hs
index 326fa549f..ee29855b4 100644
--- a/test.hs
+++ b/test.hs
@@ -215,6 +215,12 @@ test_copy = "git-annex copy" ~: TestCase $ intmpclonerepo $ do
test_lock :: Test
test_lock = "git-annex unlock/lock" ~: intmpclonerepo $ do
+ -- regression test: unlock of not present file should skip it
+ annexed_notpresent annexedfile
+ r <- git_annex "unlock" ["-q", annexedfile]
+ r @? "unlock failed with not present file"
+ annexed_notpresent annexedfile
+
git_annex "get" ["-q", annexedfile] @? "get of file failed"
annexed_present annexedfile
git_annex "unlock" ["-q", annexedfile] @? "unlock failed"
@@ -232,8 +238,8 @@ test_lock = "git-annex unlock/lock" ~: intmpclonerepo $ do
runchecks [checklink, checkunwritable] annexedfile
c <- readFile annexedfile
assertEqual ("content of modified file") c (changedcontent annexedfile)
- r <- git_annex "drop" ["-q", annexedfile]
- (not r) @? "drop wrongly succeeded with no known copy of modified file"
+ r' <- git_annex "drop" ["-q", annexedfile]
+ not r' @? "drop wrongly succeeded with no known copy of modified file"
test_edit :: Test
test_edit = "git-annex edit/commit" ~: TestList [t False, t True]