我尝试使用git-difftool
来区分整个目录,并收到以下错误:
$ git difftool -d
/usr/lib/git-core/git-difftool line 266: File exists
另一种方法是使用--no-symlinks
选项,但这意味着我无法编辑diff工具(meld)中的文件。
$ git --version
git version 1.9.1
这是负责错误的perl脚本的一部分:
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 }
我打印了这些变量并注意到它尝试创建符号链接的文件/目录不存在。