summaryrefslogtreecommitdiff
path: root/Command/Lock.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 /Command/Lock.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 'Command/Lock.hs')
-rw-r--r--Command/Lock.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Command/Lock.hs b/Command/Lock.hs
index 8b36e1cee..4e42a8d76 100644
--- a/Command/Lock.hs
+++ b/Command/Lock.hs
@@ -46,7 +46,7 @@ startNew file key = ifM (isJust <$> isAnnexLink file)
)
where
go (Just key')
- | key' == key = cont False
+ | key' == key = error "content not present; cannot lock"
| otherwise = errorModified
go Nothing =
ifM (isUnmodified key file)