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.
This commit is contained in:
Joey Hess 2016-01-06 16:01:52 -04:00
parent d667a68b7e
commit 0c1cc7789f
Failed to extract signature
2 changed files with 5 additions and 3 deletions

View file

@ -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)