avoid creating work tree files in subdirectories in an edge case

A keyName could contain "/", though this is unlikely and certianly only
ever could happen with WORM keys.

The change to addunused to escape that is no problem at all.

The change to VariantFile to escape it means that different versions of
git-annex could resolve a merge conflict differently in this case, which
is unfortunate. There would be different .variant files used, so the two
resolutions would themselves merge together without additional
conflicts, but the user would have to clean up the extra .variant
files.
This commit is contained in:
Joey Hess 2019-01-14 13:07:18 -04:00
parent d3ab5e626b
commit 1791447cc8
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 9 additions and 5 deletions

View file

@ -32,7 +32,7 @@ perform key = next $ do
addLink file key Nothing
return True
where
file = "unused." ++ serializeKey key
file = "unused." ++ keyFile key
{- The content is not in the annex, but in another directory, and
- it seems better to error out, rather than moving bad/tmp content into