summaryrefslogtreecommitdiff
path: root/t/t7800-difftool.sh
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 /t/t7800-difftool.sh
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 't/t7800-difftool.sh')
-rwxr-xr-xt/t7800-difftool.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index d46f041..2418528 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -385,6 +385,25 @@ test_expect_success PERL,SYMLINKS 'difftool --dir-diff --symlink without unstage
test_cmp actual expect
'
+write_script modify-right-file <<\EOF
+echo "new content" >"$2/file"
+EOF
+
+run_dir_diff_test 'difftool --dir-diff syncs worktree with unstaged change' '
+ test_when_finished git reset --hard &&
+ echo "orig content" >file &&
+ git difftool -d $symlinks --extcmd "$(pwd)/modify-right-file" branch &&
+ echo "new content" >expect &&
+ test_cmp expect file
+'
+
+run_dir_diff_test 'difftool --dir-diff syncs worktree without unstaged change' '
+ test_when_finished git reset --hard &&
+ git difftool -d $symlinks --extcmd "$(pwd)/modify-right-file" branch &&
+ echo "new content" >expect &&
+ test_cmp expect file
+'
+
write_script modify-file <<\EOF
echo "new content" >file
EOF