summaryrefslogtreecommitdiff
path: root/git-difftool.perl
diff options
context:
space:
mode:
authorKenichi Saita <nitoyon@gmail.com>2013-05-29 16:01:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-05-29 19:50:08 (GMT)
commit32eaf1de7f79c4ba09f3de3261c84e52e0a67af5 (patch)
tree116a16ece696460c5bcb469ddfe3740d5aa5e6f4 /git-difftool.perl
parentedca4152560522a431a51fc0a06147fc680b5b18 (diff)
downloadgit-32eaf1de7f79c4ba09f3de3261c84e52e0a67af5.zip
git-32eaf1de7f79c4ba09f3de3261c84e52e0a67af5.tar.gz
git-32eaf1de7f79c4ba09f3de3261c84e52e0a67af5.tar.bz2
difftool --dir-diff: allow changing any clean working tree file
The temporary directory prepared by "difftool --dir-diff" to show the result of a change can be modified by the user via the tree diff program, and we try hard not to lose changes to them after tree diff program returns to us. However, the set of files to be copied back is computed differently between --symlinks and --no-symlinks modes. The former checks all paths that start out as identical to the working tree file, while the latter checks paths that already had a local modification in the working tree, allowing changes made in the tree diff program to paths that did not have any local change to be lost. Signed-off-by: Kenichi Saita <nitoyon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-difftool.perl')
-rwxr-xr-xgit-difftool.perl9
1 files changed, 2 insertions, 7 deletions
diff --git a/git-difftool.perl b/git-difftool.perl
index 8a75205..e57d3d12 100755
--- a/git-difftool.perl
+++ b/git-difftool.perl
@@ -85,13 +85,9 @@ sub exit_cleanup
sub use_wt_file
{
- my ($repo, $workdir, $file, $sha1, $symlinks) = @_;
+ my ($repo, $workdir, $file, $sha1) = @_;
my $null_sha1 = '0' x 40;
- if ($sha1 ne $null_sha1 and not $symlinks) {
- return 0;
- }
-
if (! -e "$workdir/$file") {
# If the file doesn't exist in the working tree, we cannot
# use it.
@@ -213,8 +209,7 @@ EOF
if ($rmode ne $null_mode) {
my ($use, $wt_sha1) = use_wt_file($repo, $workdir,
- $dst_path, $rsha1,
- $symlinks);
+ $dst_path, $rsha1);
if ($use) {
push @working_tree, $dst_path;
$wtindex .= "$rmode $wt_sha1\t$dst_path\0";