Merge branch 'jk/bisect-show-tree'
[gitweb.git] / git-difftool.perl
index 8cf0040590645fedca47e25a9167511e7c27c8e9..ebd13baa6e06cf7007fdd5c48713f06cf511721d 100755 (executable)
@@ -138,6 +138,7 @@ sub setup_dir_diff
        my %submodule;
        my %symlink;
        my @working_tree = ();
+       my %working_tree_dups = ();
        my @rawdiff = split('\0', $diffrtn);
 
        my $i = 0;
@@ -188,6 +189,10 @@ sub setup_dir_diff
                }
 
                if ($rmode ne $null_mode) {
+                       # Avoid duplicate working_tree entries
+                       if ($working_tree_dups{$dst_path}++) {
+                               next;
+                       }
                        my ($use, $wt_sha1) = use_wt_file($repo, $workdir,
                                                          $dst_path, $rsha1);
                        if ($use) {