difftool: handle unmerged files in dir-diff mode
authorDavid Aguilar <davvid@gmail.com>
Mon, 16 May 2016 18:05:37 +0000 (11:05 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 May 2016 21:53:05 +0000 (14:53 -0700)
When files are unmerged they can show up as both unmerged and
modified in the output of `git diff --raw`. This causes
difftool's dir-diff to create filesystem entries for the same
path twice, which fails when it encounters a duplicate path.

Ensure that each worktree path is only processed once.
Add a test to demonstrate the breakage.

Reported-by: Jan Smets <jan@smets.cx>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found