6

I try to diff an entire directory with git-difftool and I get the following error:

$ git difftool -d
/usr/lib/git-core/git-difftool line 266: File exists

The alternative is to use the --no-symlinks option, but that means that I cannot edit the files inside the diff tool (meld).

$ git --version
git version 1.9.1

This is the part of the perl script responsible for the error:

256    # Changes in the working tree need special treatment since they are
257    # not part of the index. Remove any trailing slash from $workdir
258    # before starting to avoid double slashes in symlink targets.
259    $workdir =~ s|/$||;
260    for my $file (@working_tree) {
261       my $dir = dirname($file);
262       unless (-d "$rdir/$dir") {
263          mkpath("$rdir/$dir") or
264          exit_cleanup($tmpdir, 1);
265       }
266       if ($symlinks) {
267          symlink("$workdir/$file", "$rdir/$file") or
268          exit_cleanup($tmpdir, 1);
269       } else {
270          copy("$workdir/$file", "$rdir/$file") or
271          exit_cleanup($tmpdir, 1);
272 
273          my $mode = stat("$workdir/$file")->mode;
274          chmod($mode, "$rdir/$file") or
275          exit_cleanup($tmpdir, 1);
276       }
277    }

I printed those variables and noticed that the files / directories where it tries to create symlinks do not exist.

Will Vousden
  • 32,488
  • 9
  • 84
  • 95
Lucian M
  • 61
  • 2
  • 1
    Fixed !I had a merge conflict that I solved, but did not stage so as to mark its resolution. Once I staged it, then unstaged it, – Lucian M Oct 19 '15 at 07:20

0 Answers0