Please describe the problem.

I've enabled annex.genmetadata to track file modification time. When I unlock, edit and re-add a file, annex imports the modification data from its previous life instead of using the edited (or unedited) file's.

Annex should always use the added file's mtime as modification time, even if there is conflicting pre-existing metadata. Even better would be if it stored modification time per-object, not worktree file.

What steps will reproduce the problem?

git init testannex; cd testannex; git annex init; git config annex.genmetadata true; touch bar; git annex add bar; git annex sync; git annex unlock bar; vim bar; git annex add bar

output: Copied metadata from old version of bar to new version. If you don't want this copied metadata, run: git annex metadata --remove-all bar

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

6.20180227, various Linuxes.

fixed --Joey