summaryrefslogtreecommitdiff
path: root/t/t7800-difftool.sh
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2010-01-15 22:03:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-15 23:04:45 (GMT)
commit9f3d54d193d9edcf443c9dd62789af5e8e47635c (patch)
tree0e774da7ac3481fb9de4e9178bb90fca2101c960 /t/t7800-difftool.sh
parentf47f1e2ce8b4022113120b32decb4436341dc3aa (diff)
downloadgit-9f3d54d193d9edcf443c9dd62789af5e8e47635c.zip
git-9f3d54d193d9edcf443c9dd62789af5e8e47635c.tar.gz
git-9f3d54d193d9edcf443c9dd62789af5e8e47635c.tar.bz2
difftool: Use eval to expand '--extcmd' expressions
It was not possible to pass quoted commands to '--extcmd'. By using 'eval' we ensure that expressions with spaces and quotes are supported. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7800-difftool.sh')
-rwxr-xr-xt/t7800-difftool.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 69e1c34..a183f1d 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -235,8 +235,21 @@ test_expect_success 'difftool --extcmd cat' '
test_expect_success 'difftool -x cat' '
diff=$(git difftool --no-prompt -x cat branch) &&
test "$diff" = branch"$LF"master
+'
+
+test_expect_success 'difftool --extcmd echo arg1' '
+ diff=$(git difftool --no-prompt --extcmd sh\ -c\ \"echo\ \$1\" branch)
+ test "$diff" = file
+'
+test_expect_success 'difftool --extcmd cat arg1' '
+ diff=$(git difftool --no-prompt --extcmd sh\ -c\ \"cat\ \$1\" branch)
+ test "$diff" = master
+'
+test_expect_success 'difftool --extcmd cat arg2' '
+ diff=$(git difftool --no-prompt --extcmd sh\ -c\ \"cat\ \$2\" branch)
+ test "$diff" = branch
'
test_done