Please describe the problem.

spent quite some time trying to figure out WTF I got some files not published due to tag being set... managed to reproduce in minimal setup -- if I set metadata to a file, rename a file (mv, git add; or even git mv), and add another file with different content but the same name -- it would obtain metadata of original key/file (unless I commit right after rename)

What steps will reproduce the problem?

see below

What version of git-annex are you using? On what operating system?


Please provide any additional information below.

$> sudo rm -rf /tmp/repo; mkdir /tmp/repo; cd /tmp/repo; git init; git annex init; echo 1 >| 1; git annex add 1; git commit -m 'added 1'; git annex metadata -s tag=value 1; git mv 1 2; git annex add 2; echo 2>1; git annex add 1; for f in 1 2; do echo "file $f"; ls -l $f; git annex metadata -g tag $f; done                                                                                                                          
Initialized empty Git repository in /tmp/repo/.git/
init  ok
(recording state in git...)
add 1 ok
(recording state in git...)
[master (root-commit) 750d619] added 1
 1 file changed, 1 insertion(+)
 create mode 120000 1
metadata 1 
(recording state in git...)

add 1 ok
(recording state in git...)
file 1
lrwxrwxrwx 1 yoh yoh 178 Sep 26 13:59 1 -> .git/annex/objects/pX/ZJ/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
file 2
lrwxrwxrwx 1 yoh yoh 178 Sep 26 13:59 2 -> .git/annex/objects/2W/V5/SHA256E-s2--4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865/SHA256E-s2--4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865

you can see in above taht 1 and 2 have different content/keys, but they both acquire the same tag=value. If I commit 2 after it being renamed from 1, it is ok.