summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f47f1e2)
raw | patch | inline | side by side (parent: f47f1e2)
author | David Aguilar <davvid@gmail.com> | |
Fri, 15 Jan 2010 22:03:44 +0000 (14:03 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 15 Jan 2010 23:04:45 +0000 (15:04 -0800) |
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>
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>
git-difftool--helper.sh | patch | blob | history | |
t/t7800-difftool.sh | patch | blob | history |
index d806eaef541742f0cd3ab47c855e01749d7b6535..69f6bcebcbc32a7d34731677cd1baa9fea473085 100755 (executable)
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
fi
if use_ext_cmd; then
- $GIT_DIFFTOOL_EXTCMD "$LOCAL" "$REMOTE"
+ eval $GIT_DIFFTOOL_EXTCMD '"$LOCAL"' '"$REMOTE"'
else
run_merge_tool "$merge_tool"
fi
-
}
if ! use_ext_cmd; then
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 69e1c3415983fea50c3a059e5fa440560591737d..a183f1db4a16b18db1b7d2c32160378ac06989fe 100755 (executable)
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
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