diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-10-03 21:49:18 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-03 21:49:19 -0700 |
commit | 6a4f5dadd3d373db29053697aaefc67e31416699 (patch) | |
tree | 5feb58eb565bb8cf8cf698c649aedd4601fe7569 /builtin | |
parent | Merge branch 'hn/refs-errno-cleanup' (diff) | |
parent | difftool: fix symlink-file writing in dir-diff mode (diff) | |
download | tgif-6a4f5dadd3d373db29053697aaefc67e31416699.tar.xz |
Merge branch 'da/difftool-dir-diff-symlink-fix'
"git difftool --dir-diff" mishandled symbolic links.
* da/difftool-dir-diff-symlink-fix:
difftool: fix symlink-file writing in dir-diff mode
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/difftool.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/difftool.c b/builtin/difftool.c index bb9fe7245a..21e055d13a 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -557,11 +557,13 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix, if (*entry->left) { add_path(&ldir, ldir_len, entry->path); ensure_leading_directories(ldir.buf); + unlink(ldir.buf); write_file(ldir.buf, "%s", entry->left); } if (*entry->right) { add_path(&rdir, rdir_len, entry->path); ensure_leading_directories(rdir.buf); + unlink(rdir.buf); write_file(rdir.buf, "%s", entry->right); } } |