When adding files to an adjusted branch set up by --unlock-present, add them unlocked, not locked

Missed this when implementing it because of the default case catching
the new constructor. So, removed that default case to make sure
future types of adjusted branches don't make the same mistake.

Complicated by git-annex addurl --fast which adds the file whose content
is not present, so it needs to stay unlocked when on such a branch.

This commit was sponsored by Brock Spratlen on Patreon.
This commit is contained in:
Joey Hess 2021-01-25 13:55:01 -04:00
parent db1e6c0625
commit 6f78497572
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 28 additions and 9 deletions

View file

@ -172,6 +172,7 @@ perform :: AddOptions -> RawFilePath -> AddUnlockedMatcher -> CommandPerform
perform o file addunlockedmatcher = withOtherTmp $ \tmpdir -> do
lockingfile <- not <$> addUnlocked addunlockedmatcher
(MatchingFile (FileInfo (Just file) file Nothing))
True
let cfg = LockDownConfig
{ lockingFile = lockingfile
, hardlinkFileTmpDir = Just tmpdir