fromkey: create directory for pointer files too

fromkey creates leading directories for symbolic links.  Do the same
for pointer files.
This commit is contained in:
Kyle Meyer 2021-05-06 11:11:14 -04:00 committed by Joey Hess
parent 5332cf8a80
commit 4450fe3629
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -106,6 +106,7 @@ perform matcher key file = lookupKeyNotHidden file >>= \case
, matchKey = Just key
}
else keyMatchInfoWithoutContent key file
createWorkTreeDirectory (parentDir file)
ifM (addUnlocked matcher mi contentpresent)
( do
stagePointerFile file Nothing =<< hashPointerFile key
@ -115,7 +116,6 @@ perform matcher key file = lookupKeyNotHidden file >>= \case
else writepointer
, do
link <- calcRepo $ gitAnnexLink file key
createWorkTreeDirectory (parentDir file)
addAnnexLink link file
)
next $ return True