aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-06-10 10:30:38 -0700
committerJunio C Hamano <gitster@pobox.com>2024-06-10 10:30:38 -0700
commit718b50e3bf313d19073ad7c26107307b32dd8908 (patch)
tree3df278d53ef70e6c088e45eb2e7e05486277c5dc /t
parent1b76f065085811104b5f4adff001956d7e5c5d1c (diff)
parent291ef5b61c569ca9d40100fec6ab16dfd65c9a32 (diff)
downloadgit-718b50e3bf313d19073ad7c26107307b32dd8908.tar.gz
Merge branch 'iw/trace-argv-on-alias'
The alias-expanded command lines are logged to the trace output. * iw/trace-argv-on-alias: run-command: show prepared command Documentation: alias: add notes on shell expansion Documentation: alias: rework notes into points
Diffstat (limited to 't')
-rwxr-xr-xt/t0014-alias.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t0014-alias.sh b/t/t0014-alias.sh
index 95568342be..854d59ec58 100755
--- a/t/t0014-alias.sh
+++ b/t/t0014-alias.sh
@@ -44,4 +44,15 @@ test_expect_success 'run-command formats empty args properly' '
test_cmp expect actual
'
+test_expect_success 'tracing a shell alias with arguments shows trace of prepared command' '
+ cat >expect <<-EOF &&
+ trace: start_command: SHELL -c ${SQ}echo \$* "\$@"${SQ} ${SQ}echo \$*${SQ} arg
+ EOF
+ git config alias.echo "!echo \$*" &&
+ env GIT_TRACE=1 git echo arg 2>output &&
+ # redact platform differences
+ sed -n -e "s/^\(trace: start_command:\) .* -c /\1 SHELL -c /p" output >actual &&
+ test_cmp expect actual
+'
+
test_done