tighten file2key to not produce invalid keys with no keyName

A file named "foo-" or "foo-bar" was taken as a key's file, with a backend
of "foo", and an empty keyName. This led to various problems, especially
because converting that key back to a file did not yeild the same filename.
This commit is contained in:
Joey Hess 2013-10-16 12:46:24 -04:00
parent 15597e5fff
commit 396e47b07e
4 changed files with 21 additions and 3 deletions

View file

@ -14,3 +14,12 @@ i get :
how could i fix this issue ?
many thanks for help
> [[done]]; I managed to reproduce this bug by making a temp file named
> ".git/annex/tmp/foo-", or indeed with any dash in it. This is enough
> to make git-annex think it's a key, but badly formed enough that
> it fails trying to use that key. Fixed to ignore such non-key files.
>
> I'm unsure why `.git/annex/tmp` would have such files in it.
> Perhaps the assistant was running, but crashed while adding files?
> --[[Joey]]