summaryrefslogtreecommitdiff
path: root/t/t3701-add-interactive.sh
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2018-09-10 14:07:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-09-11 20:38:50 (GMT)
commit79336116f5769fb53b0d84e21e984ae300f0c6a5 (patch)
tree06a8bfd72947589f134d2d46d384fade7db29173 /t/t3701-add-interactive.sh
parentfc54c1af3ec09bab8b8ea09768c2da4069b7f53e (diff)
downloadgit-79336116f5769fb53b0d84e21e984ae300f0c6a5.zip
git-79336116f5769fb53b0d84e21e984ae300f0c6a5.tar.gz
git-79336116f5769fb53b0d84e21e984ae300f0c6a5.tar.bz2
t3701-add-interactive: tighten the check of trace output
The test 'add -p does not expand argument lists' in 't3701-add-interactive.sh', added in 7288e12cce (add--interactive: do not expand pathspecs with ls-files, 2017-03-14), checks the GIT_TRACE of 'git add -p' to ensure that the name of a tracked file wasn't passed around as argument to any of the commands executed as a result of undesired pathspec expansion. This check is done with 'grep' using the filename on its own as the pattern, which is too loose a pattern, and would match any occurrences of the filename in the trace output, not just those as command arguments. E.g. if a developer were to litter the index handling code with trace_printf()s printing, among other things, the name of the just processed cache entry, then that pattern would mistakenly match these as well, and would fail the test. Tighten this 'grep' pattern to only match trace lines that show the executed commands. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3701-add-interactive.sh')
-rwxr-xr-xt/t3701-add-interactive.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index b170fb0..14e82f7 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -497,7 +497,7 @@ test_expect_success 'add -p does not expand argument lists' '
# update it, but we want to be sure that our "." pathspec
# was not expanded into the argument list of any command.
# So look only for "not-changed".
- ! grep not-changed trace.out
+ ! grep -E "^trace: (built-in|exec|run_command): .*not-changed" trace.out
'
test_expect_success 'hunk-editing handles custom comment char' '