summaryrefslogtreecommitdiff
path: root/t/t7610-mergetool.sh
diff options
context:
space:
mode:
authorCharles Bailey <charles@hashpling.org>2009-01-21 22:57:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-01-27 09:13:19 (GMT)
commit0ec7b6c26dad51f690cd985d4a5357634123c4b7 (patch)
treeb7a81348292f44b0b4e98e849b283d98f2f67b16 /t/t7610-mergetool.sh
parentb80da424a13107c239ed40573fae3d692d19b6cd (diff)
downloadgit-0ec7b6c26dad51f690cd985d4a5357634123c4b7.zip
git-0ec7b6c26dad51f690cd985d4a5357634123c4b7.tar.gz
git-0ec7b6c26dad51f690cd985d4a5357634123c4b7.tar.bz2
mergetool: respect autocrlf by using checkout-index
Previously, git mergetool used cat-file which does not perform git to worktree conversion. This changes mergetool to use git checkout-index instead which means that the temporary files used for mergetool use the correct line endings for the platform. Signed-off-by: Charles Bailey <charles@hashpling.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7610-mergetool.sh')
-rwxr-xr-xt/t7610-mergetool.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index 09fa5f1..edb6a57 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -34,13 +34,24 @@ test_expect_success 'custom mergetool' '
git config merge.tool mytool &&
git config mergetool.mytool.cmd "cat \"\$REMOTE\" >\"\$MERGED\"" &&
git config mergetool.mytool.trustExitCode true &&
- git checkout branch1 &&
+ git checkout branch1 &&
test_must_fail git merge master >/dev/null 2>&1 &&
( yes "" | git mergetool file1>/dev/null 2>&1 ) &&
( yes "" | git mergetool file2>/dev/null 2>&1 ) &&
test "$(cat file1)" = "master updated" &&
test "$(cat file2)" = "master new" &&
- git commit -m "branch1 resolved with mergetool"
+ git commit -m "branch1 resolved with mergetool"
+'
+
+test_expect_success 'mergetool crlf' '
+ git config core.autocrlf true &&
+ git reset --hard HEAD^
+ test_must_fail git merge master >/dev/null 2>&1 &&
+ ( yes "" | git mergetool file1>/dev/null 2>&1 ) &&
+ ( yes "" | git mergetool file2>/dev/null 2>&1 ) &&
+ test "$(printf x | cat file1 -)" = "$(printf "master updated\r\nx")" &&
+ test "$(printf x | cat file2 -)" = "$(printf "master new\r\nx")" &&
+ git commit -m "branch1 resolved with mergetool - autocrlf"
'
test_done