t3910: show failure of core.precomposeunicode with decomposed filenames
[gitweb.git] / t / t7800-difftool.sh
index d46f0411bd9a08b38035c8fb5ca611723b8baed2..5a193c500d282cc2b13e8de6e128229585897a16 100755 (executable)
@@ -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
@@ -415,4 +434,18 @@ test_expect_success PERL 'difftool --no-symlinks detects conflict ' '
        )
 '
 
+test_expect_success PERL 'difftool properly honors gitlink and core.worktree' '
+       git submodule add ./. submod/ule &&
+       (
+               cd submod/ule &&
+               test_config diff.tool checktrees &&
+               test_config difftool.checktrees.cmd '\''
+                       test -d "$LOCAL" && test -d "$REMOTE" && echo good
+               '\'' &&
+               echo good >expect &&
+               git difftool --tool=checktrees --dir-diff HEAD~ >actual &&
+               test_cmp expect actual
+       )
+'
+
 test_done