aboutsummaryrefslogtreecommitdiff
path: root/Test.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-01-06 16:01:52 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-01-06 16:01:52 -0400
commitbf0069b0df73eb9e9c8c508c45eaf7d6f90b5deb (patch)
tree965e24c8e687629a9fc8295ef4356e9f174b7ee1 /Test.hs
parent82a27da0157ce3fc78ab917b6d9d26486ed7bb8c (diff)
fix test failure locking an unlocked not present file
In v5, that was not possible, but it is in v6, and so the test was failing. Investigating, it turns out that locking was copying the pointer file content to the annex object despite the content not being present. So, add a check to prevent that.
Diffstat (limited to 'Test.hs')
-rw-r--r--Test.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Test.hs b/Test.hs
index fdb1404cb..5646f14e1 100644
--- a/Test.hs
+++ b/Test.hs
@@ -546,9 +546,11 @@ test_preferred_content = intmpclonerepo $ do
test_lock :: Assertion
test_lock = intmpclonerepoInDirect $ do
- -- regression test: unlock of not present file should skip it
annexed_notpresent annexedfile
- not <$> git_annex "unlock" [annexedfile] @? "unlock failed to fail with not present file"
+ ifM (unlockedFiles <$> getTestMode)
+ ( not <$> git_annex "lock" [annexedfile] @? "lock failed to fail with not present file"
+ , not <$> git_annex "unlock" [annexedfile] @? "unlock failed to fail with not present file"
+ )
annexed_notpresent annexedfile
-- regression test: unlock of newly added, not committed file