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.