Replace bare grep with test_grep in test assertions across the
suite, including sourced test helpers (lib-*.sh, *-tests.sh).
test_grep prints the contents of the file being searched on
failure, making debugging easier than a bare grep which fails
silently.
Only assertion-style greps are converted: grep used as a filter
in pipelines, command substitutions, conditionals, or with
redirected I/O is left as-is with a "# lint-ok" annotation.
Existing '! test_grep' calls are rewritten to 'test_grep !' so
that the diagnostic output is preserved on failure.
test_grep requires the file it reads to exist, so '! grep'
assertions that inspect a file whose presence is conditional need
care. In t5537 the '.git/shallow' file is still present after the
repack (the client remains shallow), so the assertion is
converted like any other. In t1400 the '.git/packed-refs' file
exists only with the files backend, so its check is guarded with a
REFFILES prerequisite; the backend-agnostic 'git show-ref' check
that follows still runs under every backend. In t7450 'git~2' is
the NTFS 8.3 short name of a '..git' file and only exists
when 8.3 short-name generation is enabled, so its check is guarded
with a 'test -f' on the path and uses test_grep inside the guard,
the same shape as t1400 (a plain test_grep would BUG when the
short name is absent).
The conversion was generated using a grep-assertion linter
(greplint.pl, added in the following commit) to identify bare
grep calls at command position. To reproduce, from the t/
directory:
# Step 1: annotate the two data-filter greps (grep produces
# data, not a verdict) so the linter skips them.
sed -i '/grep -vf before commits\.raw/s/$/ # lint-ok: data filter/' \
t5326-multi-pack-bitmaps.sh
sed -i '/grep -E "^\[0-9a-f\].*|| :/s/$/ # lint-ok: data filter/' \
t5702-protocol-v2.sh
# Step 1b: two '! grep' assertions need more than a mechanical
# conversion; handle them by hand before the linter-driven steps
# below so it leaves them alone.
#
# t1400: '.git/packed-refs' is absent under reftable, so guard the
# check with REFFILES (a plain test_grep would BUG on the missing
# file):
#
# git update-ref -d HEAD $B &&
# - ! grep "$m" .git/packed-refs &&
# + if test_have_prereq REFFILES
# + then
# + test_grep ! "$m" .git/packed-refs
# + fi &&
# test_must_fail git show-ref --verify -q $m
#
# t7450: git~2 is an NTFS 8.3 short name that exists only when
# short-name generation is enabled, so guard the check on its
# presence with 'test -f' and note in a comment why the path can
# be absent (a plain test_grep would BUG when it is):
#
# - ! grep gitdir squatting-clone/d/a/git~2
# + if test -f squatting-clone/d/a/git~2
# + then
# + test_grep ! gitdir squatting-clone/d/a/git~2
# + fi
# Step 2: reorder pre-existing '! test_grep' to 'test_grep !'
# (must come before steps 3-4 so greplint does not see them)
sed -i 's/! test_grep/test_grep !/' t0031-lockfile-pid.sh
sed -i 's/! test_grep/test_grep !/' t5300-pack-object.sh
sed -i 's/! test_grep/test_grep !/' t5319-multi-pack-index.sh
# Step 3: convert '! grep' -> 'test_grep !'
perl greplint.pl *.sh 2>&1 | cut -d: -f1,2 |
while IFS=: read f l; do
sed -i "${l}s/! *grep/test_grep !/" "$f"
done
# Step 4: convert remaining 'grep' -> 'test_grep'
perl greplint.pl *.sh 2>&1 | cut -d: -f1,2 |
while IFS=: read f l; do
sed -i "${l}s/grep/test_grep/" "$f"
done
To verify, run: make -C t test-greplint
Signed-off-by: Michael Montalbo <mmontalbo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Montalbo committedJul 6, 2026 at 05:01 UTC47f79f619834acdd39d39bd1d3b33bf57f80d0a2
338 files changed+2815-2806
t/for-each-ref-tests.sh
+6-6
index bd2d45c971..6b359d940e 100644--- a/t/for-each-ref-tests.sh+++ b/t/for-each-ref-tests.sh@@ -523,7 +523,7 @@ test_expect_success 'Verify descending sort' ' test_expect_success 'Give help even with invalid sort atoms' ' test_expect_code 129 ${git_for_each_ref} --sort=bogus -h >actual 2>&1 &&- grep "^usage: ${git_for_each_ref}" actual+ test_grep "^usage: ${git_for_each_ref}" actual ' cat >expected <<\EOF@@ -622,7 +622,7 @@ test_expect_success 'Quoting style: tcl' ' for i in "--perl --shell" "-s --python" "--python --tcl" "--tcl --perl"; do test_expect_success "more than one quoting style: $i" " test_must_fail ${git_for_each_ref} $i 2>err &&- grep '^error: more than one quoting style' err+ test_grep '^error: more than one quoting style' err " done@@ -1892,7 +1892,7 @@ test_expect_success "${git_for_each_ref} --stdin: fails if extra args" ' >in && test_must_fail ${git_for_each_ref} --format="%(refname)" \ --stdin refs/heads/extra <in 2>err &&- grep "unknown arguments supplied with --stdin" err+ test_grep "unknown arguments supplied with --stdin" err ' test_expect_success "${git_for_each_ref} --stdin: matches" '@@ -1955,11 +1955,11 @@ test_expect_success "${git_for_each_ref} with nested tags" ' test_expect_success 'is-base atom with non-commits' ' ${git_for_each_ref} --format="%(is-base:HEAD) %(refname)" >out 2>err &&- grep "(HEAD) refs/heads/main" out &&+ test_grep "(HEAD) refs/heads/main" out && test_line_count = 2 err &&- grep "error: object .* is a commit, not a blob" err &&- grep "error: bad tag pointer to" err+ test_grep "error: object .* is a commit, not a blob" err &&+ test_grep "error: bad tag pointer to" err ' GRADE_FORMAT="%(signature:grade)%0a%(signature:key)%0a%(signature:signer)%0a%(signature:fingerprint)%0a%(signature:primarykeyfingerprint)"
index 36e8e9df33..1351f690eb 100644--- a/t/show-ref-exists-tests.sh+++ b/t/show-ref-exists-tests.sh@@ -19,7 +19,7 @@ test_expect_success '--exists with missing reference' ' test_expect_success '--exists does not use DWIM' ' test_expect_code 2 ${git_show_ref_exists} $GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME 2>err &&- grep "reference does not exist" err+ test_grep "reference does not exist" err ' test_expect_success '--exists with HEAD' '
t/t0000-basic.sh
+8-8
index 2b63e1c86c..7bd1f4e7b7 100755--- a/t/t0000-basic.sh+++ b/t/t0000-basic.sh@@ -743,7 +743,7 @@ test_expect_success 'subtest: lazy prereqs do not turn off tracing' ' test_done EOF- grep "echo trace" lazy-prereq-and-tracing/err+ test_grep "echo trace" lazy-prereq-and-tracing/err ' test_expect_success 'subtest: tests clean up after themselves' '@@ -815,7 +815,7 @@ test_expect_success 'subtest: test_atexit is run' ' test_expect_success 'test_oid provides sane info by default' ' test_oid zero >actual &&- grep "^00*\$" actual &&+ test_grep "^00*\$" actual && rawsz="$(test_oid rawsz)" && hexsz="$(test_oid hexsz)" && # +1 accounts for the trailing newline@@ -827,7 +827,7 @@ test_expect_success 'test_oid can look up data for SHA-1' ' test_when_finished "test_detect_hash" && test_set_hash sha1 && test_oid zero >actual &&- grep "^00*\$" actual &&+ test_grep "^00*\$" actual && rawsz="$(test_oid rawsz)" && hexsz="$(test_oid hexsz)" && test $(wc -c <actual) -eq 41 &&@@ -839,7 +839,7 @@ test_expect_success 'test_oid can look up data for SHA-256' ' test_when_finished "test_detect_hash" && test_set_hash sha256 && test_oid zero >actual &&- grep "^00*\$" actual &&+ test_grep "^00*\$" actual && rawsz="$(test_oid rawsz)" && hexsz="$(test_oid hexsz)" && test $(wc -c <actual) -eq 65 &&@@ -884,11 +884,11 @@ test_expect_success 'test_bool_env' ' # test script, hence the redirection of fd 7, and aborts # with "exit 1", hence the subshell. ! ( test_bool_env envvar true ) 7>err &&- grep "error: test_bool_env requires bool values" err &&+ test_grep "error: test_bool_env requires bool values" err && envvar=true && ! ( test_bool_env envvar invalid ) 7>err &&- grep "error: test_bool_env requires bool values" err+ test_grep "error: test_bool_env requires bool values" err ) '@@ -1242,12 +1242,12 @@ test_expect_success 'test_must_fail on a failing git command with env' ' test_expect_success 'test_must_fail rejects a non-git command' ' ! test_must_fail grep ^$ notafile 2>err &&- grep -F "test_must_fail: only '"'"'git'"'"' is allowed" err+ test_grep -F "test_must_fail: only '"'"'git'"'"' is allowed" err ' test_expect_success 'test_must_fail rejects a non-git command with env' ' ! test_must_fail env var1=a var2=b grep ^$ notafile 2>err &&- grep -F "test_must_fail: only '"'"'git'"'"' is allowed" err+ test_grep -F "test_must_fail: only '"'"'git'"'"' is allowed" err ' test_done
t/t0001-init.sh
+9-9
index e4d32bb4d2..7dcd1e9d48 100755--- a/t/t0001-init.sh+++ b/t/t0001-init.sh@@ -278,9 +278,9 @@ test_expect_success POSIXPERM 'init creates a new deep directory (umask vs. shar git init --bare --shared=0660 newdir/a/b/c && test_path_is_dir newdir/a/b/c/refs && ls -ld newdir/a newdir/a/b > lsab.out &&- ! grep -v "^drwxrw[sx]r-x" lsab.out &&+ test_grep ! -v "^drwxrw[sx]r-x" lsab.out && ls -ld newdir/a/b/c > lsc.out &&- ! grep -v "^drwxrw[sx]---" lsc.out+ test_grep ! -v "^drwxrw[sx]---" lsc.out ) '@@ -619,7 +619,7 @@ test_expect_success DEFAULT_REPO_FORMAT 'extensions.refStorage is not allowed wi git init refstorage && git -C refstorage config extensions.refStorage files && test_must_fail git -C refstorage rev-parse 2>err &&- grep "repo version is 0, but v1-only extension found" err+ test_grep "repo version is 0, but v1-only extension found" err ' test_expect_success DEFAULT_REPO_FORMAT 'extensions.refStorage with files backend' '@@ -637,7 +637,7 @@ test_expect_success DEFAULT_REPO_FORMAT 'extensions.refStorage with unknown back git -C refstorage config core.repositoryformatversion 1 && git -C refstorage config extensions.refStorage garbage && test_must_fail git -C refstorage rev-parse 2>err &&- grep "invalid value for ${SQ}extensions.refstorage${SQ}: ${SQ}garbage${SQ}" err+ test_grep "invalid value for ${SQ}extensions.refstorage${SQ}: ${SQ}garbage${SQ}" err ' test_expect_success 'init with GIT_DEFAULT_REF_FORMAT=garbage' '@@ -848,8 +848,8 @@ test_expect_success MINGW 'redirect std handles' ' GIT_REDIRECT_STDOUT=output.txt \ GIT_REDIRECT_STDERR="2>&1" \ git rev-parse --git-dir --verify refs/invalid &&- grep "^\\.git\$" output.txt &&- grep "Needed a single revision" output.txt+ test_grep "^\\.git\$" output.txt &&+ test_grep "Needed a single revision" output.txt ' test_expect_success '--initial-branch' '@@ -862,14 +862,14 @@ test_expect_success '--initial-branch' ' git init --initial-branch=ignore initial-branch-option 2>err && test_grep "ignored --initial-branch" err && git -C initial-branch-option symbolic-ref HEAD >actual &&- grep hello actual+ test_grep hello actual ' test_expect_success 'overridden default initial branch name (config)' ' test_config_global init.defaultBranch nmb && GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= git init initial-branch-config && git -C initial-branch-config symbolic-ref HEAD >actual &&- grep nmb actual+ test_grep nmb actual ' test_expect_success 'advice on unconfigured init.defaultBranch' '@@ -907,7 +907,7 @@ test_expect_success 'overridden default main branch name (env)' ' test_config_global init.defaultBranch nmb && GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=env git init main-branch-env && git -C main-branch-env symbolic-ref HEAD >actual &&- grep env actual+ test_grep env actual ' test_expect_success 'invalid default branch name' '
t/t0008-ignores.sh
+4-4
index d77a179bdd..ed95faf327 100755--- a/t/t0008-ignores.sh+++ b/t/t0008-ignores.sh@@ -790,8 +790,8 @@ test_expect_success 'existing file and directory' ' >one && mkdir top-level-dir && git check-ignore one top-level-dir >actual &&- grep one actual &&- grep top-level-dir actual+ test_grep one actual &&+ test_grep top-level-dir actual ' test_expect_success 'existing directory and file' '@@ -800,8 +800,8 @@ test_expect_success 'existing directory and file' ' >one && mkdir top-level-dir && git check-ignore top-level-dir one >actual &&- grep one actual &&- grep top-level-dir actual+ test_grep one actual &&+ test_grep top-level-dir actual ' test_expect_success 'exact prefix matching (with root)' '
t/t0009-git-dir-validation.sh
+3-3
index 33d21ed9ea..4cba478e50 100755--- a/t/t0009-git-dir-validation.sh+++ b/t/t0009-git-dir-validation.sh@@ -35,7 +35,7 @@ test_expect_success PIPE 'setup: .git as a FIFO (named pipe) is rejected' ' cd parent/fifo-trap && mkfifo .git && test_must_fail git rev-parse --git-dir 2>stderr &&- grep "not a regular file" stderr+ test_grep "not a regular file" stderr ) '@@ -47,7 +47,7 @@ test_expect_success SYMLINKS,PIPE 'setup: .git as a symlink to a FIFO is rejecte mkfifo target-fifo && ln -s target-fifo .git && test_must_fail git rev-parse --git-dir 2>stderr &&- grep "not a regular file" stderr+ test_grep "not a regular file" stderr ) '@@ -58,7 +58,7 @@ test_expect_success 'setup: .git with garbage content is rejected' ' cd parent/garbage-trap && echo "garbage" >.git && test_must_fail git rev-parse --git-dir 2>stderr &&- grep "invalid gitfile format" stderr+ test_grep "invalid gitfile format" stderr ) '
t/t0012-help.sh
+2-2
index c33501bdcd..48d128ad04 100755--- a/t/t0012-help.sh+++ b/t/t0012-help.sh@@ -131,8 +131,8 @@ test_expect_success 'git help succeeds without git.html' ' test_expect_success 'git help --user-interfaces' ' git help --user-interfaces >help.output &&- grep "^ attributes " help.output &&- grep "^ mailmap " help.output+ test_grep "^ attributes " help.output &&+ test_grep "^ mailmap " help.output ' test_expect_success 'git help -c' '
index 32fe848179..da02bce0ef 100755--- a/t/t0017-env-helper.sh+++ b/t/t0017-env-helper.sh@@ -88,7 +88,7 @@ test_expect_success 'test-tool env-helper reads config thanks to trace2' ' test_must_fail \ env HOME="$(pwd)/home" \ git config -l 2>err &&- grep "exceeded maximum include depth" err &&+ test_grep "exceeded maximum include depth" err && # This validates that the assumption that we attempt to # read the configuration and fail very early in the start-up@@ -100,7 +100,7 @@ test_expect_success 'test-tool env-helper reads config thanks to trace2' ' test-tool -C no-such-directory \ env-helper --type=bool --default=0 \ --exit-code GIT_TEST_ENV_HELPER 2>err &&- grep "exceeded maximum include depth" err+ test_grep "exceeded maximum include depth" err ' test_done
t/t0021-conversion.sh
+9-9
index f0d50d769e..50994a6ada 100755--- a/t/t0021-conversion.sh+++ b/t/t0021-conversion.sh@@ -731,7 +731,7 @@ test_expect_success 'process filter should restart after unexpected write failur rm -f debug.log && git checkout --quiet --no-progress . 2>git-stderr.log &&- grep "smudge write error" git-stderr.log &&+ test_grep "smudge write error" git-stderr.log && test_grep "error: external filter" git-stderr.log && cat >expected.log <<-EOF &&@@ -853,7 +853,7 @@ test_expect_success 'invalid process filter must fail (and not hang!)' ' cp "$TEST_ROOT/test.o" test.r && test_must_fail git add . 2>git-stderr.log &&- grep "expected git-filter-server" git-stderr.log+ test_grep "expected git-filter-server" git-stderr.log ) '@@ -953,7 +953,7 @@ test_expect_success 'missing file in delayed checkout' ' rm -rf repo-cloned && test_must_fail git clone repo repo-cloned 2>git-stderr.log &&- grep "error: .missing-delay\.a. was not filtered properly" git-stderr.log+ test_grep "error: .missing-delay\.a. was not filtered properly" git-stderr.log ' test_expect_success 'invalid file in delayed checkout' '@@ -974,7 +974,7 @@ test_expect_success 'invalid file in delayed checkout' ' rm -rf repo-cloned && test_must_fail git clone repo repo-cloned 2>git-stderr.log &&- grep "error: external filter .* signaled that .unfiltered. is now available although it has not been delayed earlier" git-stderr.log+ test_grep "error: external filter .* signaled that .unfiltered. is now available although it has not been delayed earlier" git-stderr.log ' for mode in 'case' 'utf-8'@@ -1015,7 +1015,7 @@ do git clone $mode-collision $mode-collision-cloned && # Make sure z was really delayed- grep "IN: smudge $dir/z .* \\[DELAYED\\]" $mode-collision-cloned/delayed.log &&+ test_grep "IN: smudge $dir/z .* \\[DELAYED\\]" $mode-collision-cloned/delayed.log && # Should not create $dir/z at $symlink/z test_path_is_missing $mode-collision/target-dir/z@@ -1053,7 +1053,7 @@ test_expect_success SYMLINKS,CASE_INSENSITIVE_FS \ git commit -m super && git checkout --recurse-submodules . &&- grep "IN: smudge A/B/y .* \\[DELAYED\\]" delayed.log &&+ test_grep "IN: smudge A/B/y .* \\[DELAYED\\]" delayed.log && test_path_is_missing target-dir/y ) '@@ -1144,9 +1144,9 @@ test_expect_success 'delayed checkout correctly reports the number of updated en rm *.a && git checkout . 2>err &&- grep "IN: smudge test-delay10.a .* \\[DELAYED\\]" delayed.log &&- grep "IN: smudge test-delay11.a .* \\[DELAYED\\]" delayed.log &&- grep "Updated 2 paths from the index" err+ test_grep "IN: smudge test-delay10.a .* \\[DELAYED\\]" delayed.log &&+ test_grep "IN: smudge test-delay11.a .* \\[DELAYED\\]" delayed.log &&+ test_grep "Updated 2 paths from the index" err ) '
index 43155f6bd8..d6e2f63c59 100755--- a/t/t0030-stripspace.sh+++ b/t/t0030-stripspace.sh@@ -407,12 +407,12 @@ test_expect_success 'strip comments with changed comment string' ' test_expect_success 'newline as commentchar is forbidden' ' test_must_fail git -c core.commentChar="$LF" stripspace -s 2>err &&- grep "core.commentchar cannot contain newline" err+ test_grep "core.commentchar cannot contain newline" err ' test_expect_success 'empty commentchar is forbidden' ' test_must_fail git -c core.commentchar= stripspace -s 2>err &&- grep "core.commentchar must have at least one character" err+ test_grep "core.commentchar must have at least one character" err ' test_expect_success '-c with single line' '
t/t0031-lockfile-pid.sh
+1-1
index 8ef87addf5..e9e2f04049 100755--- a/t/t0031-lockfile-pid.sh+++ b/t/t0031-lockfile-pid.sh@@ -29,7 +29,7 @@ test_expect_success 'PID info not shown by default' ' test_must_fail git add . 2>err && # Should not crash, just show normal error without PID test_grep "Unable to create" err &&- ! test_grep "is held by process" err+ test_grep ! "is held by process" err ) '
index e38ca7a901..81ed41742c 100755--- a/t/t0091-bugreport.sh+++ b/t/t0091-bugreport.sh@@ -40,15 +40,15 @@ test_expect_success 'sanity check "System Info" section' ' # The beginning should match "git version --build-options" verbatim, # but rather than checking bit-for-bit equality, just test some basics.- grep "git version " system &&- grep "shell-path: ." system &&+ test_grep "git version " system &&+ test_grep "shell-path: ." system && # After the version, there should be some more info. # This is bound to differ from environment to environment, # so we just do some rather high-level checks.- grep "uname: ." system &&- grep "compiler info: ." system &&- grep "zlib." system+ test_grep "uname: ." system &&+ test_grep "compiler info: ." system &&+ test_grep "zlib." system ' test_expect_success 'dies if file with same name as report already exists' '@@ -112,7 +112,7 @@ test_expect_success UNZIP '--diagnose creates diagnostics zip archive' ' git bugreport --diagnose -o report -s test >out && zip_path=report/git-diagnostics-test.zip &&- grep "Available space" out &&+ test_grep "Available space" out && test_path_is_file "$zip_path" && # Check zipped archive content@@ -120,10 +120,10 @@ test_expect_success UNZIP '--diagnose creates diagnostics zip archive' ' test_file_not_empty out && "$GIT_UNZIP" -p "$zip_path" packs-local.txt >out &&- grep ".git/objects" out &&+ test_grep ".git/objects" out && "$GIT_UNZIP" -p "$zip_path" objects-local.txt >out &&- grep "^Total: [0-9][0-9]*" out &&+ test_grep "^Total: [0-9][0-9]*" out && # Should not include .git directory contents by default ! "$GIT_UNZIP" -l "$zip_path" | grep ".git/"@@ -136,7 +136,7 @@ test_expect_success UNZIP '--diagnose=stats excludes .git dir contents' ' # Includes pack quantity/size info "$GIT_UNZIP" -p "$zip_path" packs-local.txt >out &&- grep ".git/objects" out &&+ test_grep ".git/objects" out && # Does not include .git directory contents ! "$GIT_UNZIP" -l "$zip_path" | grep ".git/"
t/t0092-diagnose.sh
+6-6
index 6cabd6e67b..0bc2b1ed5c 100755--- a/t/t0092-diagnose.sh+++ b/t/t0092-diagnose.sh@@ -8,7 +8,7 @@ test_expect_success UNZIP 'creates diagnostics zip archive' ' test_when_finished rm -rf report && git diagnose -o report -s test >out &&- grep "Available space" out &&+ test_grep "Available space" out && zip_path=report/git-diagnostics-test.zip && test_path_is_file "$zip_path" &&@@ -18,10 +18,10 @@ test_expect_success UNZIP 'creates diagnostics zip archive' ' test_file_not_empty out && "$GIT_UNZIP" -p "$zip_path" packs-local.txt >out &&- grep ".git/objects" out &&+ test_grep ".git/objects" out && "$GIT_UNZIP" -p "$zip_path" objects-local.txt >out &&- grep "^Total: [0-9][0-9]*" out &&+ test_grep "^Total: [0-9][0-9]*" out && # Should not include .git directory contents by default ! "$GIT_UNZIP" -l "$zip_path" | grep ".git/"@@ -34,7 +34,7 @@ test_expect_success UNZIP 'counts loose objects' ' git diagnose -o test-count -s 1 >out && zip_path=test-count/git-diagnostics-1.zip && "$GIT_UNZIP" -p "$zip_path" objects-local.txt >out &&- grep "^Total: [1-9][0-9]* loose objects" out+ test_grep "^Total: [1-9][0-9]* loose objects" out ' test_expect_success UNZIP '--mode=stats excludes .git dir contents' '@@ -45,7 +45,7 @@ test_expect_success UNZIP '--mode=stats excludes .git dir contents' ' # Includes pack quantity/size info zip_path=report/git-diagnostics-test.zip && "$GIT_UNZIP" -p "$zip_path" packs-local.txt >out &&- grep ".git/objects" out &&+ test_grep ".git/objects" out && # Does not include .git directory contents ! "$GIT_UNZIP" -l "$zip_path" | grep ".git/"@@ -59,7 +59,7 @@ test_expect_success UNZIP '--mode=all includes .git dir contents' ' # Includes pack quantity/size info zip_path=report/git-diagnostics-test.zip && "$GIT_UNZIP" -p "$zip_path" packs-local.txt >out &&- grep ".git/objects" out &&+ test_grep ".git/objects" out && # Includes .git directory contents "$GIT_UNZIP" -l "$zip_path" | grep ".git/" &&
t/t0100-previous.sh
+1-1
index dd5d9b4e5e..87a9995ea4 100755--- a/t/t0100-previous.sh+++ b/t/t0100-previous.sh@@ -50,7 +50,7 @@ test_expect_success 'merge @{-1}~1' ' git checkout main && git merge @{-1}~1 && git cat-file commit HEAD >actual &&- grep "Merge branch '\''other'\''" actual+ test_grep "Merge branch '\''other'\''" actual ' test_expect_success 'merge @{-100} before checking out that many branches yet' '
t/t0200-gettext-basic.sh
+7-7
index 8853d8afb9..8db26c1ada 100755--- a/t/t0200-gettext-basic.sh+++ b/t/t0200-gettext-basic.sh@@ -16,7 +16,7 @@ test_expect_success 'sanity: $TEXTDOMAIN is git' ' ' test_expect_success 'xgettext sanity: Perl _() strings are not extracted' '- ! grep "A Perl string xgettext will not get" "$GIT_PO_PATH"/is.po+ test_grep ! "A Perl string xgettext will not get" "$GIT_PO_PATH"/is.po ' test_expect_success 'xgettext sanity: Comment extraction with --add-comments' '@@ -26,8 +26,8 @@ test_expect_success 'xgettext sanity: Comment extraction with --add-comments' ' ' test_expect_success 'xgettext sanity: Comment extraction with --add-comments stops at statements' '- ! grep "This is a phony" "$GIT_PO_PATH"/is.po &&- ! grep "the above comment" "$GIT_PO_PATH"/is.po+ test_grep ! "This is a phony" "$GIT_PO_PATH"/is.po &&+ test_grep ! "the above comment" "$GIT_PO_PATH"/is.po ' test_expect_success GETTEXT 'sanity: $TEXTDOMAINDIR exists without NO_GETTEXT=YesPlease' '@@ -44,10 +44,10 @@ test_expect_success GETTEXT 'sanity: Icelandic locale was compiled' ' test_expect_success GETTEXT_LOCALE 'sanity: gettext("") metadata is OK' ' # Return value may be non-zero LANGUAGE=is LC_ALL="$is_IS_locale" gettext "" >zero-expect &&- grep "Project-Id-Version: Git" zero-expect &&- grep "Git Mailing List <git@vger.kernel.org>" zero-expect &&- grep "Content-Type: text/plain; charset=UTF-8" zero-expect &&- grep "Content-Transfer-Encoding: 8bit" zero-expect+ test_grep "Project-Id-Version: Git" zero-expect &&+ test_grep "Git Mailing List <git@vger.kernel.org>" zero-expect &&+ test_grep "Content-Type: text/plain; charset=UTF-8" zero-expect &&+ test_grep "Content-Transfer-Encoding: 8bit" zero-expect ' test_expect_success GETTEXT_LOCALE 'sanity: gettext(unknown) is passed through' '
t/t0203-gettext-setlocale-sanity.sh
+2-2
index 0ce1f22eff..670082bf09 100755--- a/t/t0203-gettext-setlocale-sanity.sh+++ b/t/t0203-gettext-setlocale-sanity.sh@@ -12,7 +12,7 @@ test_expect_success 'git show a ISO-8859-1 commit under C locale' ' test_commit "iso-c-commit" iso-under-c && git show >out 2>err && test_must_be_empty err &&- grep -q "iso-c-commit" out+ test_grep -q "iso-c-commit" out ' test_expect_success GETTEXT_LOCALE 'git show a ISO-8859-1 commit under a UTF-8 locale' '@@ -20,7 +20,7 @@ test_expect_success GETTEXT_LOCALE 'git show a ISO-8859-1 commit under a UTF-8 l test_commit "iso-utf8-commit" iso-under-utf8 && LANGUAGE=is LC_ALL="$is_IS_locale" git show >out 2>err && test_must_be_empty err &&- grep -q "iso-utf8-commit" out+ test_grep -q "iso-utf8-commit" out ' test_done
index 760cf69087..665c8b3669 100755--- a/t/t0211-trace2-perf.sh+++ b/t/t0211-trace2-perf.sh@@ -283,13 +283,13 @@ test_expect_success 'unsafe URLs are redacted by default' ' GIT_TRACE2_PERF="$(pwd)/trace.perf" \ git clone https://user:pwd@example.com/ clone &&- ! grep user:pwd trace.perf &&+ test_grep ! user:pwd trace.perf && GIT_TRACE2_REDACT=0 GIT_TRACE2_PERF="$(pwd)/unredacted.perf" \ git clone https://user:pwd@example.com/ clone2 && perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <unredacted.perf >actual &&- grep "d0|main|start|.* clone https://user:pwd@example.com" actual &&- grep "d0|main|def_param|.*|remote.origin.url:https://user:pwd@example.com" actual+ test_grep "d0|main|start|.* clone https://user:pwd@example.com" actual &&+ test_grep "d0|main|def_param|.*|remote.origin.url:https://user:pwd@example.com" actual ' # Confirm that the requested command produces a "cmd_name" and a@@ -358,13 +358,13 @@ test_expect_success LIBCURL \ perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <prop.perf >actual &&- grep "d0|main|cmd_name|.*|_run_dashed_" actual &&- grep "d0|main|def_param|.*|cfg.prop.foo:red" actual &&- grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual &&+ test_grep "d0|main|cmd_name|.*|_run_dashed_" actual &&+ test_grep "d0|main|def_param|.*|cfg.prop.foo:red" actual &&+ test_grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual &&- grep "d1|main|cmd_name|.*|remote-curl" actual &&- grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&- grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual+ test_grep "d1|main|cmd_name|.*|remote-curl" actual &&+ test_grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&+ test_grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual ' # Similarly, `git-http-fetch` is not built from git.c so do a@@ -389,13 +389,13 @@ test_expect_success LIBCURL \ perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <prop.perf >actual &&- grep "d0|main|cmd_name|.*|_run_dashed_" actual &&- grep "d0|main|def_param|.*|cfg.prop.foo:red" actual &&- grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual &&+ test_grep "d0|main|cmd_name|.*|_run_dashed_" actual &&+ test_grep "d0|main|def_param|.*|cfg.prop.foo:red" actual &&+ test_grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual &&- grep "d1|main|cmd_name|.*|http-fetch" actual &&- grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&- grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual+ test_grep "d1|main|cmd_name|.*|http-fetch" actual &&+ test_grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&+ test_grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual ' # Historically, alias expansion explicitly emitted the def_param@@ -421,22 +421,22 @@ test_expect_success 'expect def_params during git alias expansion' ' perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <prop.perf >actual && # "git xxx" is first mapped to "git-xxx" and the child will fail.- grep "d0|main|cmd_name|.*|_run_dashed_ (_run_dashed_)" actual &&+ test_grep "d0|main|cmd_name|.*|_run_dashed_ (_run_dashed_)" actual && # We unpeel that and substitute "version" into "xxx" (giving # "git version") and update the cmd_name event.- grep "d0|main|cmd_name|.*|_run_git_alias_ (_run_dashed_/_run_git_alias_)" actual &&+ test_grep "d0|main|cmd_name|.*|_run_git_alias_ (_run_dashed_/_run_git_alias_)" actual && # These def_param events could be associated with either of the # above cmd_name events. It does not matter.- grep "d0|main|def_param|.*|cfg.prop.foo:red" actual &&- grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual &&+ test_grep "d0|main|def_param|.*|cfg.prop.foo:red" actual &&+ test_grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual && # The "git version" child sees a different cmd_name hierarchy. # Also test the def_param (only for completeness).- grep "d1|main|cmd_name|.*|version (_run_dashed_/_run_git_alias_/version)" actual &&- grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&- grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual+ test_grep "d1|main|cmd_name|.*|version (_run_dashed_/_run_git_alias_/version)" actual &&+ test_grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&+ test_grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual ' test_expect_success 'expect def_params during shell alias expansion' '@@ -456,25 +456,25 @@ test_expect_success 'expect def_params during shell alias expansion' ' perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <prop.perf >actual && # "git xxx" is first mapped to "git-xxx" and the child will fail.- grep "d0|main|cmd_name|.*|_run_dashed_ (_run_dashed_)" actual &&+ test_grep "d0|main|cmd_name|.*|_run_dashed_ (_run_dashed_)" actual && # We unpeel that and substitute "git version" for "git xxx" (as a # shell command. Another cmd_name event is emitted as we unpeel.- grep "d0|main|cmd_name|.*|_run_shell_alias_ (_run_dashed_/_run_shell_alias_)" actual &&+ test_grep "d0|main|cmd_name|.*|_run_shell_alias_ (_run_dashed_/_run_shell_alias_)" actual && # These def_param events could be associated with either of the # above cmd_name events. It does not matter.- grep "d0|main|def_param|.*|cfg.prop.foo:red" actual &&- grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual &&+ test_grep "d0|main|def_param|.*|cfg.prop.foo:red" actual &&+ test_grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual && # We get the following only because we used a git command for the # shell command. In general, it could have been a shell script and # we would see nothing. # # The child knows the cmd_name hierarchy so it includes it.- grep "d1|main|cmd_name|.*|version (_run_dashed_/_run_shell_alias_/version)" actual &&- grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&- grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual+ test_grep "d1|main|cmd_name|.*|version (_run_dashed_/_run_shell_alias_/version)" actual &&+ test_grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&+ test_grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual ' test_expect_success 'expect def_params during nested git alias expansion' '@@ -496,33 +496,33 @@ test_expect_success 'expect def_params during nested git alias expansion' ' # "git xxx" is first mapped to "git-xxx" and try to spawn "git-xxx" # and the child will fail.- grep "d0|main|cmd_name|.*|_run_dashed_ (_run_dashed_)" actual &&- grep "d0|main|child_start|.*|.* class:dashed argv:\[git-xxx\]" actual &&+ test_grep "d0|main|cmd_name|.*|_run_dashed_ (_run_dashed_)" actual &&+ test_grep "d0|main|child_start|.*|.* class:dashed argv:\[git-xxx\]" actual && # We unpeel that and substitute "yyy" into "xxx" (giving "git yyy") # and spawn "git-yyy" and the child will fail.- grep "d0|main|alias|.*|alias:xxx argv:\[yyy\]" actual &&- grep "d0|main|cmd_name|.*|_run_dashed_ (_run_dashed_/_run_dashed_)" actual &&- grep "d0|main|child_start|.*|.* class:dashed argv:\[git-yyy\]" actual &&+ test_grep "d0|main|alias|.*|alias:xxx argv:\[yyy\]" actual &&+ test_grep "d0|main|cmd_name|.*|_run_dashed_ (_run_dashed_/_run_dashed_)" actual &&+ test_grep "d0|main|child_start|.*|.* class:dashed argv:\[git-yyy\]" actual && # We unpeel that and substitute "version" into "xxx" (giving # "git version") and update the cmd_name event.- grep "d0|main|alias|.*|alias:yyy argv:\[version\]" actual &&- grep "d0|main|cmd_name|.*|_run_git_alias_ (_run_dashed_/_run_dashed_/_run_git_alias_)" actual &&+ test_grep "d0|main|alias|.*|alias:yyy argv:\[version\]" actual &&+ test_grep "d0|main|cmd_name|.*|_run_git_alias_ (_run_dashed_/_run_dashed_/_run_git_alias_)" actual && # These def_param events could be associated with any of the # above cmd_name events. It does not matter. grep "d0|main|def_param|.*|cfg.prop.foo:red" actual >actual.matches &&- grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual &&+ test_grep "d0|main|def_param|.*|ENV_PROP_FOO:blue" actual && # However, we do not want them repeated each time we unpeel. test_line_count = 1 actual.matches && # The "git version" child sees a different cmd_name hierarchy. # Also test the def_param (only for completeness).- grep "d1|main|cmd_name|.*|version (_run_dashed_/_run_dashed_/_run_git_alias_/version)" actual &&- grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&- grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual+ test_grep "d1|main|cmd_name|.*|version (_run_dashed_/_run_dashed_/_run_git_alias_/version)" actual &&+ test_grep "d1|main|def_param|.*|cfg.prop.foo:red" actual &&+ test_grep "d1|main|def_param|.*|ENV_PROP_FOO:blue" actual ' test_done
t/t0212-trace2-event.sh
+4-4
index 1211db9f46..f5358a1dd4 100755--- a/t/t0212-trace2-event.sh+++ b/t/t0212-trace2-event.sh@@ -332,7 +332,7 @@ test_expect_success 'unsafe URLs are redacted by default in cmd_start events' ' GIT_TRACE2_EVENT="$(pwd)/trace.event" \ test-tool trace2 300redact_start git clone https://user:pwd@example.com/ clone2 &&- ! grep user:pwd trace.event+ test_grep ! user:pwd trace.event ' test_expect_success 'unsafe URLs are redacted by default in child_start events' '@@ -341,7 +341,7 @@ test_expect_success 'unsafe URLs are redacted by default in child_start events' GIT_TRACE2_EVENT="$(pwd)/trace.event" \ test-tool trace2 301redact_child_start git clone https://user:pwd@example.com/ clone2 &&- ! grep user:pwd trace.event+ test_grep ! user:pwd trace.event ' test_expect_success 'unsafe URLs are redacted by default in exec events' '@@ -350,7 +350,7 @@ test_expect_success 'unsafe URLs are redacted by default in exec events' ' GIT_TRACE2_EVENT="$(pwd)/trace.event" \ test-tool trace2 302redact_exec git clone https://user:pwd@example.com/ clone2 &&- ! grep user:pwd trace.event+ test_grep ! user:pwd trace.event ' test_expect_success 'unsafe URLs are redacted by default in def_param events' '@@ -359,7 +359,7 @@ test_expect_success 'unsafe URLs are redacted by default in def_param events' ' GIT_TRACE2_EVENT="$(pwd)/trace.event" \ test-tool trace2 303redact_def_param url https://user:pwd@example.com/ &&- ! grep user:pwd trace.event+ test_grep ! user:pwd trace.event ' test_done
index e19e036898..2f4c5e2a1b 100755--- a/t/t0610-reftable-basics.sh+++ b/t/t0610-reftable-basics.sh@@ -776,11 +776,11 @@ test_expect_success 'reflog: can delete separate reflog entries' ' test_commit file3 && test_commit file4 && git reflog >actual &&- grep file3 actual &&+ test_grep file3 actual && git reflog delete HEAD@{1} && git reflog >actual &&- ! grep file3 actual+ test_grep ! file3 actual ) '@@ -902,8 +902,8 @@ test_expect_success 'reflog: garbage collection deletes reflog entries' ' done && git reflog refs/heads/main >actual && test_line_count = 10 actual &&- grep "commit (initial): number 1" actual &&- grep "commit: number 10" actual &&+ test_grep "commit (initial): number 1" actual &&+ test_grep "commit: number 10" actual && git gc && git reflog refs/heads/main >actual &&
t/t1004-read-tree-m-u-wf.sh
+4-4
index 11bf10424f..70ba3eea4d 100755--- a/t/t1004-read-tree-m-u-wf.sh+++ b/t/t1004-read-tree-m-u-wf.sh@@ -142,8 +142,8 @@ test_expect_success '3-way not overwriting local changes (our side)' ' echo >>file1 "local changes" && read_tree_u_must_succeed -m -u branch-point side-a side-b &&- grep "new line to be kept" file1 &&- grep "local changes" file1+ test_grep "new line to be kept" file1 &&+ test_grep "local changes" file1 '@@ -156,8 +156,8 @@ test_expect_success '3-way not overwriting local changes (their side)' ' echo >>file2 "local changes" && read_tree_u_must_fail -m -u branch-point side-a side-b &&- ! grep "new line to be kept" file2 &&- grep "local changes" file2+ test_grep ! "new line to be kept" file2 &&+ test_grep "local changes" file2 '
t/t1006-cat-file.sh
+9-9
index 8e2c52652c..762c77c351 100755--- a/t/t1006-cat-file.sh+++ b/t/t1006-cat-file.sh@@ -696,8 +696,8 @@ test_expect_success '%(deltabase) reports packed delta bases' ' git repack -ad && git cat-file --batch-check="%(deltabase)" <blobs >actual && {- grep "$(git rev-parse HEAD:foo)" actual ||- grep "$(git rev-parse HEAD:foo-plus)" actual+ test_grep "$(git rev-parse HEAD:foo)" actual ||+ test_grep "$(git rev-parse HEAD:foo-plus)" actual } '@@ -826,7 +826,7 @@ test_expect_success 'cat-file -t and -s on corrupt loose object' ' # Swap the two to corrupt the repository mv -f "$other_path" "$empty_path" && test_must_fail git fsck 2>err.fsck &&- grep "hash-path mismatch" err.fsck &&+ test_grep "hash-path mismatch" err.fsck && # confirm that cat-file is reading the new swapped-in # blob...@@ -1318,37 +1318,37 @@ test_expect_success 'cat-file --batch-all-objects --batch-check ignores replace' test_expect_success 'batch-command empty command' ' echo "" >cmd && test_expect_code 128 git cat-file --batch-command <cmd 2>err &&- grep "^fatal:.*empty command in input.*" err+ test_grep "^fatal:.*empty command in input.*" err ' test_expect_success 'batch-command whitespace before command' ' echo " info deadbeef" >cmd && test_expect_code 128 git cat-file --batch-command <cmd 2>err &&- grep "^fatal:.*whitespace before command.*" err+ test_grep "^fatal:.*whitespace before command.*" err ' test_expect_success 'batch-command unknown command' ' echo unknown_command >cmd && test_expect_code 128 git cat-file --batch-command <cmd 2>err &&- grep "^fatal:.*unknown command.*" err+ test_grep "^fatal:.*unknown command.*" err ' test_expect_success 'batch-command missing arguments' ' echo "info" >cmd && test_expect_code 128 git cat-file --batch-command <cmd 2>err &&- grep "^fatal:.*info requires arguments.*" err+ test_grep "^fatal:.*info requires arguments.*" err ' test_expect_success 'batch-command flush with arguments' ' echo "flush arg" >cmd && test_expect_code 128 git cat-file --batch-command --buffer <cmd 2>err &&- grep "^fatal:.*flush takes no arguments.*" err+ test_grep "^fatal:.*flush takes no arguments.*" err ' test_expect_success 'batch-command flush without --buffer' ' echo "flush" >cmd && test_expect_code 128 git cat-file --batch-command <cmd 2>err &&- grep "^fatal:.*flush is only for --buffer mode.*" err+ test_grep "^fatal:.*flush is only for --buffer mode.*" err ' perl_script='
t/t1007-hash-object.sh
+4-4
index de076293b6..4782a6246a 100755--- a/t/t1007-hash-object.sh+++ b/t/t1007-hash-object.sh@@ -202,7 +202,7 @@ done test_expect_success 'too-short tree' ' echo abc >malformed-tree && test_must_fail git hash-object -t tree malformed-tree 2>err &&- grep "too-short tree object" err+ test_grep "too-short tree object" err ' test_expect_success PERL_TEST_HELPERS 'malformed mode in tree' '@@ -210,7 +210,7 @@ test_expect_success PERL_TEST_HELPERS 'malformed mode in tree' ' bin_oid=$(echo $hex_oid | hex2oct) && printf "9100644 \0$bin_oid" >tree-with-malformed-mode && test_must_fail git hash-object -t tree tree-with-malformed-mode 2>err &&- grep "malformed mode in tree entry" err+ test_grep "malformed mode in tree entry" err ' test_expect_success PERL_TEST_HELPERS 'empty filename in tree' '@@ -218,7 +218,7 @@ test_expect_success PERL_TEST_HELPERS 'empty filename in tree' ' bin_oid=$(echo $hex_oid | hex2oct) && printf "100644 \0$bin_oid" >tree-with-empty-filename && test_must_fail git hash-object -t tree tree-with-empty-filename 2>err &&- grep "empty filename in tree entry" err+ test_grep "empty filename in tree entry" err ' test_expect_success PERL_TEST_HELPERS 'duplicate filename in tree' '@@ -229,7 +229,7 @@ test_expect_success PERL_TEST_HELPERS 'duplicate filename in tree' ' printf "100644 file\0$bin_oid" } >tree-with-duplicate-filename && test_must_fail git hash-object -t tree tree-with-duplicate-filename 2>err &&- grep "duplicateEntries" err+ test_grep "duplicateEntries" err ' test_expect_success 'corrupt commit' '
index 75e89c4b6e..2cb3c7cc9c 100755--- a/t/t1515-rev-parse-outside-repo.sh+++ b/t/t1515-rev-parse-outside-repo.sh@@ -32,7 +32,7 @@ test_expect_success 'rev-parse --local-env-vars' ' git rev-parse --local-env-vars >actual && # we do not want to depend on the complete list here, # so just look for something plausible- grep ^GIT_DIR actual+ test_grep ^GIT_DIR actual ' test_expect_success 'rev-parse --resolve-git-dir' '
t/t1800-hook.sh
+9-9
index 0132e772e4..9aae3ff074 100755--- a/t/t1800-hook.sh+++ b/t/t1800-hook.sh@@ -79,7 +79,7 @@ test_expect_success 'git hook usage' ' test_expect_code 129 git hook run --unknown 2>err && test_expect_code 129 git hook list && test_expect_code 129 git hook list -h &&- grep "unknown option" err+ test_grep "unknown option" err ' test_expect_success 'git hook list: unknown hook name is rejected' '@@ -361,9 +361,9 @@ test_expect_success 'hook can be configured for multiple events' ' # 'ghi' should be included in both 'pre-commit' and 'test-hook' git hook list pre-commit >actual &&- grep "ghi" actual &&+ test_grep "ghi" actual && git hook list --allow-unknown-hook-name test-hook >actual &&- grep "ghi" actual+ test_grep "ghi" actual ' test_expect_success 'git hook list shows hooks from the hookdir' '@@ -569,7 +569,7 @@ test_expect_success 'git hook run a hook with a bad shebang' ' # TODO: We should emit the same (or at least a more similar) # error on MINGW (essentially Git for Windows) and all other # platforms.. See the OS-specific code in start_command()- grep -E "^(error|fatal): cannot (exec|spawn) .*bad-hooks/test-hook" err+ test_grep -E "^(error|fatal): cannot (exec|spawn) .*bad-hooks/test-hook" err ' test_expect_success 'stdin to hooks' '@@ -826,8 +826,8 @@ test_expect_success 'git hook run -j2 warns for hooks not marked parallel=true' # neither hook has parallel=true git hook run --allow-unknown-hook-name -j2 test-hook >out 2>err &&- grep "hook .hook-1. is not marked as parallel=true" err &&- grep "hook .hook-2. is not marked as parallel=true" err+ test_grep "hook .hook-1. is not marked as parallel=true" err &&+ test_grep "hook .hook-2. is not marked as parallel=true" err ' test_expect_success 'hook.jobs=1 config runs hooks in series' '@@ -1068,7 +1068,7 @@ test_expect_success 'hook.jobs=-1 resolves to online_cpus()' ' cpus=$(test-tool online-cpus) && GIT_TRACE2_EVENT="$(pwd)/trace.txt" \ git hook run --allow-unknown-hook-name test-hook >out 2>err &&- grep "\"region_enter\".*\"hook\".*\"test-hook\".*\"max:$cpus\"" trace.txt+ test_grep "\"region_enter\".*\"hook\".*\"test-hook\".*\"max:$cpus\"" trace.txt ' test_expect_success 'hook.<event>.jobs=-1 resolves to online_cpus()' '@@ -1081,7 +1081,7 @@ test_expect_success 'hook.<event>.jobs=-1 resolves to online_cpus()' ' cpus=$(test-tool online-cpus) && GIT_TRACE2_EVENT="$(pwd)/trace.txt" \ git hook run --allow-unknown-hook-name test-hook >out 2>err &&- grep "\"region_enter\".*\"hook\".*\"test-hook\".*\"max:$cpus\"" trace.txt+ test_grep "\"region_enter\".*\"hook\".*\"test-hook\".*\"max:$cpus\"" trace.txt ' test_expect_success 'git hook run -j-1 resolves to online_cpus()' '@@ -1092,7 +1092,7 @@ test_expect_success 'git hook run -j-1 resolves to online_cpus()' ' cpus=$(test-tool online-cpus) && GIT_TRACE2_EVENT="$(pwd)/trace.txt" \ git hook run --allow-unknown-hook-name -j-1 test-hook >out 2>err &&- grep "\"region_enter\".*\"hook\".*\"test-hook\".*\"max:$cpus\"" trace.txt+ test_grep "\"region_enter\".*\"hook\".*\"test-hook\".*\"max:$cpus\"" trace.txt ' test_expect_success 'hook.jobs rejects values less than -1' '
t/t2004-checkout-cache-temp.sh
+2-2
index 0afe0ff7ca..db06c321ed 100755--- a/t/t2004-checkout-cache-temp.sh+++ b/t/t2004-checkout-cache-temp.sh@@ -132,8 +132,8 @@ test_expect_success 'overriding --stage=all resets implied --temp' ' test_expect_success '--stage=all --no-temp is rejected' ' rm -f path* .merge_* actual && test_must_fail git checkout-index --stage=all --no-temp -- path1 2>err &&- grep -v "already exists" err &&- grep "options .--stage=all. and .--no-temp. cannot be used together" err+ test_grep -v "already exists" err &&+ test_grep "options .--stage=all. and .--no-temp. cannot be used together" err ' test_expect_success 'checkout some stages/one file to temporary files' '
index a3b1449ef1..752e7f0e61 100755--- a/t/t2024-checkout-dwim.sh+++ b/t/t2024-checkout-dwim.sh@@ -311,7 +311,7 @@ test_expect_success 'loosely defined local base branch is reported correctly' ' git checkout loose >actual.raw 2>&1 && sed -e "s/loose/BRANCHNAME/g" <actual.raw >actual && status_uno_is_clean &&- grep BRANCHNAME actual &&+ test_grep BRANCHNAME actual && test_cmp expect actual '@@ -324,7 +324,7 @@ test_expect_success 'reject when arg could be part of dwim branch' ' echo bar >dwim-arg && test_must_fail git checkout dwim-arg && test_must_fail git rev-parse refs/heads/dwim-arg -- &&- grep bar dwim-arg+ test_grep bar dwim-arg ' test_expect_success 'disambiguate dwim branch and checkout path (1)' '@@ -334,7 +334,7 @@ test_expect_success 'disambiguate dwim branch and checkout path (1)' ' echo bar >dwim-arg1 && git checkout -- dwim-arg1 && test_must_fail git rev-parse refs/heads/dwim-arg1 -- &&- grep foo dwim-arg1+ test_grep foo dwim-arg1 ' test_expect_success 'disambiguate dwim branch and checkout path (2)' '@@ -344,7 +344,7 @@ test_expect_success 'disambiguate dwim branch and checkout path (2)' ' echo bar >dwim-arg2 && git checkout dwim-arg2 -- && git rev-parse refs/heads/dwim-arg2 -- &&- grep bar dwim-arg2+ test_grep bar dwim-arg2 ' test_done
t/t2030-unresolve-info.sh
+3-3
index be3fcdde07..9af24b1204 100755--- a/t/t2030-unresolve-info.sh+++ b/t/t2030-unresolve-info.sh@@ -122,7 +122,7 @@ test_expect_success 'add records checkout -m undoes' ' check_resolve_undo removed && echo the index and the work tree is unmerged again && git diff >actual &&- grep "^++<<<<<<<" actual+ test_grep "^++<<<<<<<" actual ' test_expect_success 'unmerge with plumbing' '@@ -173,7 +173,7 @@ test_expect_success 'rerere and rerere forget' ' test -f .git/rr-cache/$rerere_id/postimage && git checkout -m fi/le && echo resurrect the conflict &&- grep "^=======" fi/le &&+ test_grep "^=======" fi/le && echo reresolve the conflict && git rerere && test "z$(cat fi/le)" = zdifferent &&@@ -199,7 +199,7 @@ test_expect_success 'rerere and rerere forget (subdirectory)' ' test -f .git/rr-cache/$rerere_id/postimage && (cd fi && git checkout -m le) && echo resurrect the conflict &&- grep "^=======" fi/le &&+ test_grep "^=======" fi/le && echo reresolve the conflict && (cd fi && git rerere) && test "z$(cat fi/le)" = zdifferent &&
t/t2060-switch.sh
+3-3
index c91c4db936..cec2fe6876 100755--- a/t/t2060-switch.sh+++ b/t/t2060-switch.sh@@ -34,13 +34,13 @@ test_expect_success 'switch and detach' ' test_expect_success 'suggestion to detach' ' test_must_fail git switch main^{commit} 2>stderr &&- grep "try again with the --detach option" stderr+ test_grep "try again with the --detach option" stderr ' test_expect_success 'suggestion to detach is suppressed with advice.suggestDetachingHead=false' ' test_config advice.suggestDetachingHead false && test_must_fail git switch main^{commit} 2>stderr &&- ! grep "try again with the --detach option" stderr+ test_grep ! "try again with the --detach option" stderr ' test_expect_success 'switch and detach current branch' '@@ -76,7 +76,7 @@ test_expect_success 'new orphan branch from empty' ' git switch --orphan new-orphan && test_commit orphan && git cat-file commit refs/heads/new-orphan >commit &&- ! grep ^parent commit &&+ test_grep ! ^parent commit && git ls-files >tracked-files && echo orphan.t >expected && test_cmp expected tracked-files
t/t2070-restore.sh
+1-1
index 16d6348b69..2c222fb934 100755--- a/t/t2070-restore.sh+++ b/t/t2070-restore.sh@@ -216,7 +216,7 @@ test_expect_success 'restore with merge options are incompatible with certain op "--staged --worktree --conflict=zdiff3" do test_must_fail git restore $opts . 2>err &&- grep "cannot be used" err || return+ test_grep "cannot be used" err || return done '
t/t2080-parallel-checkout-basics.sh
+7-7
index 5ffe1a41e2..88a6ec1826 100755--- a/t/t2080-parallel-checkout-basics.sh+++ b/t/t2080-parallel-checkout-basics.sh@@ -200,13 +200,13 @@ test_expect_success 'parallel checkout respects --[no]-force' ' # We expect 0 workers because there is nothing to be done test_checkout_workers 0 git checkout HEAD && test_path_is_file D &&- grep changed D &&- grep changed F.t &&+ test_grep changed D &&+ test_grep changed F.t && test_checkout_workers 2 git checkout --force HEAD && test_path_is_dir D &&- grep D/F D/F.t &&- grep F F.t+ test_grep D/F D/F.t &&+ test_grep F F.t ) '@@ -224,8 +224,8 @@ test_expect_success SYMLINKS 'parallel checkout checks for symlinks in leading d test_checkout_workers 2 git checkout --force HEAD && ! test -h D &&- grep D/A D/A.t &&- grep D/B D/B.t+ test_grep D/A D/A.t &&+ test_grep D/B D/B.t ) '@@ -268,7 +268,7 @@ test_expect_success '"git checkout ." report should not include failed entries' # - missing-delay.a: the delay filter will drop this path # - parallel-*.a: the blob will be missing #- grep "Updated 3 paths from the index" err &&+ test_grep "Updated 3 paths from the index" err && test_stdout_line_count = 3 ls *.b && ! ls *.a )
t/t2081-parallel-checkout-collisions.sh
+12-12
index f6fcfc0c1e..db45f5f30f 100755--- a/t/t2081-parallel-checkout-collisions.sh+++ b/t/t2081-parallel-checkout-collisions.sh@@ -78,8 +78,8 @@ test_expect_success CASE_INSENSITIVE_FS 'worker detects dirname collision' ' # Check that it used the right number of workers and detected the collisions test_workers_in_event_trace 2 trace &&- grep "category.:.pcheckout.,.key.:.collision/dirname.,.value.:.A/B.}" trace &&- grep "category.:.pcheckout.,.key.:.collision/dirname.,.value.:.A/C.}" trace+ test_grep "category.:.pcheckout.,.key.:.collision/dirname.,.value.:.A/B.}" trace &&+ test_grep "category.:.pcheckout.,.key.:.collision/dirname.,.value.:.A/C.}" trace ' test_expect_success SYMLINKS,CASE_INSENSITIVE_FS 'do not follow symlinks colliding with leading dir' '@@ -115,11 +115,11 @@ test_expect_success CASE_INSENSITIVE_FS 'collision report on clone (w/ racy file set_checkout_config 2 0 && test_checkout_workers 2 git clone . clone-repo 2>stderr &&- grep FILE_X stderr &&- grep FILE_x stderr &&- grep file_X stderr &&- grep file_x stderr &&- grep "the following paths have collided" stderr+ test_grep FILE_X stderr &&+ test_grep FILE_x stderr &&+ test_grep file_X stderr &&+ test_grep file_x stderr &&+ test_grep "the following paths have collided" stderr ' # This test ensures that the collision report code is correctly looking for@@ -148,11 +148,11 @@ test_expect_success CASE_INSENSITIVE_FS,!MINGW,!CYGWIN \ test_checkout_workers 2 \ git -c core.ignoreCase=false clone . clone-repo 2>stderr &&- grep FILE_X stderr &&- grep FILE_x stderr &&- grep file_X stderr &&- grep file_x stderr &&- grep "the following paths have collided" stderr &&+ test_grep FILE_X stderr &&+ test_grep FILE_x stderr &&+ test_grep file_X stderr &&+ test_grep file_x stderr &&+ test_grep "the following paths have collided" stderr && # Check that only "file_x" was filtered echo file_x >expected.log &&
t/t2082-parallel-checkout-attributes.sh
+6-6
index 79fb11f139..1f43c2a267 100755--- a/t/t2082-parallel-checkout-attributes.sh+++ b/t/t2082-parallel-checkout-attributes.sh@@ -28,8 +28,8 @@ test_expect_success 'parallel-checkout with ident' ' rm A B && test_checkout_workers 2 git reset --hard && hexsz=$(test_oid hexsz) &&- grep -E "\\\$Id: [0-9a-f]{$hexsz} \\\$" A &&- grep "\\\$Id\\\$" B+ test_grep -E "\\\$Id: [0-9a-f]{$hexsz} \\\$" A &&+ test_grep "\\\$Id\\\$" B ) '@@ -175,15 +175,15 @@ test_expect_success 'parallel-checkout and delayed checkout' ' verify_checkout delayed && # Check that the *.d files got to the delay queue and were filtered- grep "smudge W.d .* \[DELAYED\]" delayed.log &&- grep "smudge X.d .* \[DELAYED\]" delayed.log &&+ test_grep "smudge W.d .* \[DELAYED\]" delayed.log &&+ test_grep "smudge X.d .* \[DELAYED\]" delayed.log && test_cmp delayed/W.d original && test_cmp delayed/X.d original && # Check that the parallel-eligible entries went to the right queue and # were not filtered- ! grep "smudge Y .* \[DELAYED\]" delayed.log &&- ! grep "smudge Z .* \[DELAYED\]" delayed.log &&+ test_grep ! "smudge Y .* \[DELAYED\]" delayed.log &&+ test_grep ! "smudge Z .* \[DELAYED\]" delayed.log && test_cmp delayed/Y original && test_cmp delayed/Z original '
t/t2103-update-index-ignore-missing.sh
+3-3
index 6938ecca86..fbfc86b1fa 100755--- a/t/t2103-update-index-ignore-missing.sh+++ b/t/t2103-update-index-ignore-missing.sh@@ -63,9 +63,9 @@ test_expect_success '--unmerged --refresh' ' git update-index --unmerged --refresh && echo 2 >two && test_must_fail git update-index --unmerged --refresh >actual &&- grep two actual &&- ! grep one actual &&- ! grep three actual+ test_grep two actual &&+ test_grep ! one actual &&+ test_grep ! three actual ' test_expect_success '--ignore-submodules --refresh (1)' '
t/t2200-add-update.sh
+1-1
index 0a96655cfe..bb019d7a7c 100755--- a/t/t2200-add-update.sh+++ b/t/t2200-add-update.sh@@ -241,7 +241,7 @@ test_expect_success 'add -u avoids rename pairing on unmerged paths' ' test_expect_success '"add -u non-existent" should fail' ' test_must_fail git add -u non-existent && git ls-files >actual &&- ! grep "non-existent" actual+ test_grep ! "non-existent" actual ' test_expect_success '"commit -a" implies "add -u" if index becomes empty' '
t/t2203-add-intent.sh
+3-3
index 44c1936e4d..69fef7e646 100755--- a/t/t2203-add-intent.sh+++ b/t/t2203-add-intent.sh@@ -57,7 +57,7 @@ test_expect_success 'intent to add does not clobber existing paths' ' git add -N file elif && empty=$(git hash-object --stdin </dev/null) && git ls-files -s >actual &&- ! grep "$empty" actual+ test_grep ! "$empty" actual ' test_expect_success 'i-t-a entry is simply ignored' '@@ -124,7 +124,7 @@ test_expect_success 'cache-tree does not ignore dir that has i-t-a entries' ' git add -N 2/1 && git commit -m committed && git ls-tree -r HEAD >actual &&- grep 2/2 actual+ test_grep 2/2 actual ) '@@ -312,7 +312,7 @@ test_expect_success 'apply --intent-to-add' ' echo new >new-ita && git add -N new-ita && git diff >expected &&- grep "new file" expected &&+ test_grep "new file" expected && git reset --hard && git apply --intent-to-add expected && git diff >actual &&
t/t2400-worktree-add.sh
+12-12
index 58b4445cc4..87b926728a 100755--- a/t/t2400-worktree-add.sh+++ b/t/t2400-worktree-add.sh@@ -122,7 +122,7 @@ test_expect_success 'die the same branch is already checked out' ' ( cd here && test_must_fail git checkout newmain 2>actual &&- grep "already used by worktree at" actual+ test_grep "already used by worktree at" actual ) '@@ -139,7 +139,7 @@ test_expect_success 'refuse to reset a branch in use elsewhere' ' git rev-parse --verify refs/heads/newmain >new.branch && git rev-parse --verify HEAD >new.head &&- grep "already used by worktree at" error &&+ test_grep "already used by worktree at" error && test_cmp old.branch new.branch && test_cmp old.head new.head &&@@ -328,7 +328,7 @@ test_wt_add_excl () { local opts="$*" && test_expect_success "'worktree add' with '$opts' has mutually exclusive options" ' test_must_fail git worktree add $opts 2>actual &&- grep -E "fatal:( options)? .* cannot be used together" actual+ test_grep -E "fatal:( options)? .* cannot be used together" actual ' }@@ -436,13 +436,13 @@ test_wt_add_orphan_hint () { (cd repo && test_commit commit) && git -C repo switch --orphan noref && test_must_fail git -C repo worktree add $opts foobar/ 2>actual &&- ! grep "error: unknown switch" actual &&- grep "hint: If you meant to create a worktree containing a new unborn branch" actual &&+ test_grep ! "error: unknown switch" actual &&+ test_grep "hint: If you meant to create a worktree containing a new unborn branch" actual && if [ $use_branch -eq 1 ] then- grep -E "^hint: +git worktree add --orphan -b [^ ]+ [^ ]+$" actual+ test_grep -E "^hint: +git worktree add --orphan -b [^ ]+ [^ ]+$" actual else- grep -E "^hint: +git worktree add --orphan [^ ]+$" actual+ test_grep -E "^hint: +git worktree add --orphan [^ ]+$" actual fi '@@ -457,8 +457,8 @@ test_expect_success "'worktree add' doesn't show orphan hint in bad/orphan HEAD git init repo && (cd repo && test_commit commit) && test_must_fail git -C repo worktree add --quiet foobar_branch foobar/ 2>actual &&- ! grep "error: unknown switch" actual &&- ! grep "hint: If you meant to create a worktree containing a new unborn branch" actual+ test_grep ! "error: unknown switch" actual &&+ test_grep ! "hint: If you meant to create a worktree containing a new unborn branch" actual ' test_expect_success 'local clone from linked checkout' '@@ -469,7 +469,7 @@ test_expect_success 'local clone from linked checkout' ' test_expect_success 'local clone --shared from linked checkout' ' git -C bare worktree add --detach ../baretree && git clone --local --shared baretree bare-clone &&- grep /bare/ bare-clone/.git/objects/info/alternates+ test_grep /bare/ bare-clone/.git/objects/info/alternates ' test_expect_success '"add" worktree with --no-checkout' '@@ -491,7 +491,7 @@ test_expect_success 'put a worktree under rebase' ' set_fake_editor && FAKE_LINES="edit 1" git rebase -i HEAD^ && git worktree list >actual &&- grep "under-rebase.*detached HEAD" actual+ test_grep "under-rebase.*detached HEAD" actual ) '@@ -533,7 +533,7 @@ test_expect_success 'checkout a branch under bisect' ' git bisect bad && git bisect good HEAD~2 && git worktree list >actual &&- grep "under-bisect.*detached HEAD" actual &&+ test_grep "under-bisect.*detached HEAD" actual && test_must_fail git worktree add new-bisect under-bisect && test_path_is_missing new-bisect )
t/t2402-worktree-list.sh
+8-8
index 93f92e854a..eeaf800d74 100755--- a/t/t2402-worktree-list.sh+++ b/t/t2402-worktree-list.sh@@ -101,8 +101,8 @@ test_expect_success '"list" all worktrees with locked annotation' ' git worktree lock locked && test_when_finished "git worktree unlock locked" && git worktree list >out &&- grep "/locked *[0-9a-f].* locked$" out &&- ! grep "/unlocked *[0-9a-f].* locked$" out+ test_grep "/locked *[0-9a-f].* locked$" out &&+ test_grep ! "/unlocked *[0-9a-f].* locked$" out ' test_expect_success '"list" all worktrees --porcelain with locked' '@@ -143,8 +143,8 @@ test_expect_success '"list" all worktrees with prunable annotation' ' git worktree add --detach unprunable && rm -rf prunable && git worktree list >out &&- grep "/prunable *[0-9a-f].* prunable$" out &&- ! grep "/unprunable *[0-9a-f].* prunable$" out+ test_grep "/prunable *[0-9a-f].* prunable$" out &&+ test_grep ! "/unprunable *[0-9a-f].* prunable$" out ' test_expect_success '"list" all worktrees --porcelain with prunable' '@@ -162,8 +162,8 @@ test_expect_success '"list" all worktrees with prunable consistent with "prune"' git worktree add --detach unprunable && rm -rf prunable && git worktree list >out &&- grep "/prunable *[0-9a-f].* prunable$" out &&- ! grep "/unprunable *[0-9a-f].* unprunable$" out &&+ test_grep "/prunable *[0-9a-f].* prunable$" out &&+ test_grep ! "/unprunable *[0-9a-f].* unprunable$" out && git worktree prune --verbose 2>out && test_grep "^Removing worktrees/prunable" out && test_grep ! "^Removing worktrees/unprunable" out@@ -184,7 +184,7 @@ test_expect_success '"list" all worktrees --verbose with locked' ' echo "$(git -C locked2 rev-parse --show-toplevel) $(git rev-parse --short HEAD) (detached HEAD)" >expect && printf "\tlocked: with reason\n" >>expect && git worktree list --verbose >out &&- grep "/locked1 *[0-9a-f].* locked$" out &&+ test_grep "/locked1 *[0-9a-f].* locked$" out && sed -n "s/ */ /g;/\/locked2 *[0-9a-f].*$/,/locked: .*$/p" <out >actual && test_cmp actual expect '@@ -266,7 +266,7 @@ test_expect_success 'broken main worktree still at the top' ' test_cmp ../expected actual && git worktree list >out && head -n 1 out >actual.2 &&- grep -F "(error)" actual.2+ test_grep -F "(error)" actual.2 ) '
t/t2403-worktree-move.sh
+3-3
index 0bb33e8b1b..69768c1207 100755--- a/t/t2403-worktree-move.sh+++ b/t/t2403-worktree-move.sh@@ -75,8 +75,8 @@ test_expect_success 'move worktree' ' git worktree move source destination && test_path_is_missing source && git worktree list --porcelain >out &&- grep "^worktree.*/destination$" out &&- ! grep "^worktree.*/source$" out &&+ test_grep "^worktree.*/destination$" out &&+ test_grep ! "^worktree.*/source$" out && git -C destination log --format=%s >actual2 && echo init >expected2 && test_cmp expected2 actual2@@ -92,7 +92,7 @@ test_expect_success 'move worktree to another dir' ' test_when_finished "git worktree move some-dir/destination destination" && test_path_is_missing destination && git worktree list --porcelain >out &&- grep "^worktree.*/some-dir/destination$" out &&+ test_grep "^worktree.*/some-dir/destination$" out && git -C some-dir/destination log --format=%s >actual2 && echo init >expected2 && test_cmp expected2 actual2
t/t2405-worktree-submodule.sh
+3-3
index 11018f37c7..f5c94d490b 100755--- a/t/t2405-worktree-submodule.sh+++ b/t/t2405-worktree-submodule.sh@@ -36,7 +36,7 @@ test_expect_success 'add superproject worktree' ' test_expect_failure 'submodule is checked out just after worktree add' ' git -C worktree diff --submodule main"^!" >out &&- grep "file1 updated" out+ test_grep "file1 updated" out ' test_expect_success 'add superproject worktree and initialize submodules' '@@ -46,7 +46,7 @@ test_expect_success 'add superproject worktree and initialize submodules' ' test_expect_success 'submodule is checked out just after submodule update in linked worktree' ' git -C worktree-submodule-update diff --submodule main"^!" >out &&- grep "file1 updated" out+ test_grep "file1 updated" out ' test_expect_success 'add superproject worktree and manually add submodule worktree' '@@ -56,7 +56,7 @@ test_expect_success 'add superproject worktree and manually add submodule worktr test_expect_success 'submodule is checked out after manually adding submodule worktree' ' git -C linked_submodule diff --submodule main"^!" >out &&- grep "file1 updated" out+ test_grep "file1 updated" out ' test_expect_success 'checkout --recurse-submodules uses $GIT_DIR for submodules in a linked worktree' '
t/t2407-worktree-heads.sh
+13-13
index 57c201869f..a6d7e0f83b 100755--- a/t/t2407-worktree-heads.sh+++ b/t/t2407-worktree-heads.sh@@ -41,10 +41,10 @@ test_expect_success 'refuse to overwrite: checked out in worktree' ' for i in 1 2 3 4 do test_must_fail git branch -f wt-$i HEAD 2>err &&- grep "cannot force update the branch" err &&+ test_grep "cannot force update the branch" err && test_must_fail git branch -D wt-$i 2>err &&- grep "cannot delete branch" err || return 1+ test_grep "cannot delete branch" err || return 1 done '@@ -57,7 +57,7 @@ test_expect_success 'refuse to overwrite: worktree in bisect' ' git -C wt-4 bisect good wt-1 && test_must_fail git branch -f wt-4 HEAD 2>err &&- grep "cannot force update the branch '\''wt-4'\'' used by worktree at.*wt-4" err+ test_grep "cannot force update the branch '\''wt-4'\'' used by worktree at.*wt-4" err ' test_expect_success 'refuse to overwrite: worktree in rebase (apply)' '@@ -67,7 +67,7 @@ test_expect_success 'refuse to overwrite: worktree in rebase (apply)' ' test_must_fail git -C wt-2 rebase --apply conflict-2 && test_must_fail git branch -f wt-2 HEAD 2>err &&- grep "cannot force update the branch '\''wt-2'\'' used by worktree at.*wt-2" err+ test_grep "cannot force update the branch '\''wt-2'\'' used by worktree at.*wt-2" err ' test_expect_success 'refuse to overwrite: worktree in rebase (merge)' '@@ -77,7 +77,7 @@ test_expect_success 'refuse to overwrite: worktree in rebase (merge)' ' test_must_fail git -C wt-2 rebase conflict-2 && test_must_fail git branch -f wt-2 HEAD 2>err &&- grep "cannot force update the branch '\''wt-2'\'' used by worktree at.*wt-2" err+ test_grep "cannot force update the branch '\''wt-2'\'' used by worktree at.*wt-2" err ' test_expect_success 'refuse to overwrite: worktree in rebase with --update-refs' '@@ -89,19 +89,19 @@ test_expect_success 'refuse to overwrite: worktree in rebase with --update-refs' for i in 3 4 do test_must_fail git branch -f can-be-updated HEAD 2>err &&- grep "cannot force update the branch '\''can-be-updated'\'' used by worktree at.*wt-3" err ||+ test_grep "cannot force update the branch '\''can-be-updated'\'' used by worktree at.*wt-3" err || return 1 done ' test_expect_success 'refuse to fetch over ref: checked out' ' test_must_fail git fetch server +refs/heads/wt-3:refs/heads/wt-3 2>err &&- grep "refusing to fetch into branch '\''refs/heads/wt-3'\''" err &&+ test_grep "refusing to fetch into branch '\''refs/heads/wt-3'\''" err && # General fetch into refs/heads/ will fail on first ref, # so use a generic error message check. test_must_fail git fetch server +refs/heads/*:refs/heads/* 2>err &&- grep "refusing to fetch into branch" err+ test_grep "refusing to fetch into branch" err ' test_expect_success 'refuse to fetch over ref: worktree in bisect' '@@ -113,7 +113,7 @@ test_expect_success 'refuse to fetch over ref: worktree in bisect' ' git -C wt-4 bisect good wt-1 && test_must_fail git fetch server +refs/heads/wt-4:refs/heads/wt-4 2>err &&- grep "refusing to fetch into branch" err+ test_grep "refusing to fetch into branch" err ' test_expect_success 'refuse to fetch over ref: worktree in rebase' '@@ -123,7 +123,7 @@ test_expect_success 'refuse to fetch over ref: worktree in rebase' ' test_must_fail git -C wt-3 rebase conflict-3 && test_must_fail git fetch server +refs/heads/wt-3:refs/heads/wt-3 2>err &&- grep "refusing to fetch into branch" err+ test_grep "refusing to fetch into branch" err ' test_expect_success 'refuse to overwrite when in error states' '@@ -149,7 +149,7 @@ test_expect_success 'refuse to overwrite when in error states' ' for i in 1 2 do test_must_fail git branch -f fake-$i HEAD 2>err &&- grep "cannot force update the branch '\''fake-$i'\'' used by worktree at" err ||+ test_grep "cannot force update the branch '\''fake-$i'\'' used by worktree at" err || return 1 done '@@ -161,13 +161,13 @@ test_expect_success 'refuse to overwrite during rebase with --update-refs' ' ( set_cat_todo_editor && test_must_fail git rebase -i --update-refs HEAD~3 >todo &&- ! grep "update-refs" todo+ test_grep ! "update-refs" todo ) && git branch -f allow-update HEAD~2 && ( set_cat_todo_editor && test_must_fail git rebase -i --update-refs HEAD~3 >todo &&- grep "update-ref refs/heads/allow-update" todo+ test_grep "update-ref refs/heads/allow-update" todo ) '
t/t2500-untracked-overwriting.sh
+4-4
index 5c0bf4d21f..8e84f29e8d 100755--- a/t/t2500-untracked-overwriting.sh+++ b/t/t2500-untracked-overwriting.sh@@ -51,7 +51,7 @@ test_expect_success 'reset --merge will preserve untracked files/dirs' ' test_must_fail git reset --merge work 2>error && test_cmp expect foo.t/file &&- grep "Updating .foo.t. would lose untracked files" error+ test_grep "Updating .foo.t. would lose untracked files" error ) '@@ -66,7 +66,7 @@ test_expect_success 'reset --keep will preserve untracked files/dirs' ' test_must_fail git reset --merge work 2>error && test_cmp expect foo.t/file &&- grep "Updating.*foo.t.*would lose untracked files" error+ test_grep "Updating.*foo.t.*would lose untracked files" error ) '@@ -214,7 +214,7 @@ test_expect_success 'git am --abort and untracked dir vs. unmerged file' ' test_must_fail git am --abort 2>errors && test_path_is_dir filler &&- grep "Updating .filler. would lose untracked files in it" errors+ test_grep "Updating .filler. would lose untracked files in it" errors ) '@@ -237,7 +237,7 @@ test_expect_success 'git am --skip and untracked dir vs deleted file' ' # Change our mind about resolutions, just skip this patch test_must_fail git am --skip 2>errors && test_path_is_dir newfile &&- grep "Updating .newfile. would lose untracked files in it" errors+ test_grep "Updating .newfile. would lose untracked files in it" errors ) '
t/t2501-cwd-empty.sh
+2-2
index be9140bbaa..eb6451d71d 100755--- a/t/t2501-cwd-empty.sh+++ b/t/t2501-cwd-empty.sh@@ -114,7 +114,7 @@ test_expect_success 'merge fails if cwd needs to be removed; recursive friendly' ) && test_path_is_dir dirORfile &&- grep "Refusing to remove the current working directory" error+ test_grep "Refusing to remove the current working directory" error ' test_expect_success 'merge fails if cwd needs to be removed' '@@ -179,7 +179,7 @@ test_incidental_untracked_dir_removal () { test_expect_success 'clean does not remove cwd incidentally' ' test_incidental_untracked_dir_removal \ git -C .. clean -fd -e warnings . >warnings &&- grep "Refusing to remove current working directory" warnings+ test_grep "Refusing to remove current working directory" warnings ' test_expect_success 'stash does not remove cwd incidentally' '
index fe72b24716..4afb2d3198 100755--- a/t/t3207-branch-submodule.sh+++ b/t/t3207-branch-submodule.sh@@ -136,7 +136,7 @@ test_expect_success 'should not create any branches if branch is not valid for a git -C sub branch branch-a && test_must_fail git branch --recurse-submodules branch-a 2>actual && test_no_branch . branch-a &&- grep "submodule .sub.: fatal: a branch named .branch-a. already exists" actual+ test_grep "submodule .sub.: fatal: a branch named .branch-a. already exists" actual ) '@@ -251,7 +251,7 @@ test_expect_success 'should get fatal error upon branch creation when submodule git branch --recurse-submodules branch-a origin/branch-a && # This should fail because super-clone does not have sub2 .git/modules test_must_fail git branch --recurse-submodules branch-b origin/branch-b 2>actual &&- grep "fatal: submodule .sub2.: unable to find submodule" actual &&+ test_grep "fatal: submodule .sub2.: unable to find submodule" actual && test_no_branch . branch-b && test_no_branch sub branch-b && # User can fix themselves by initializing the submodule
t/t3301-notes.sh
+16-16
index d6c50460d0..18a6000171 100755--- a/t/t3301-notes.sh+++ b/t/t3301-notes.sh@@ -164,7 +164,7 @@ test_expect_success 'show notes' ' ${indent}b1 EOF git cat-file commit HEAD >commits &&- ! grep b1 commits &&+ test_grep ! b1 commits && git log -1 >actual && test_cmp expect actual '@@ -248,17 +248,17 @@ test_expect_success 'git log --show-notes' ' test_expect_success 'git log --no-notes' ' git log -1 --no-notes >actual &&- ! grep xyzzy actual+ test_grep ! xyzzy actual ' test_expect_success 'git format-patch does not show notes' ' git format-patch -1 --stdout >actual &&- ! grep xyzzy actual+ test_grep ! xyzzy actual ' test_expect_success 'git format-patch --show-notes does show notes' ' git format-patch --show-notes -1 --stdout >actual &&- grep xyzzy actual+ test_grep xyzzy actual ' for pretty in \@@ -281,36 +281,36 @@ test_expect_success 'setup alternate notes ref' ' test_expect_success 'git log --notes shows default notes' ' git log -1 --notes >actual &&- grep xyzzy actual &&- ! grep alternate actual+ test_grep xyzzy actual &&+ test_grep ! alternate actual ' test_expect_success 'git log --notes=X shows only X' ' git log -1 --notes=alternate >actual &&- ! grep xyzzy actual &&- grep alternate actual+ test_grep ! xyzzy actual &&+ test_grep alternate actual ' test_expect_success 'git log --notes --notes=X shows both' ' git log -1 --notes --notes=alternate >actual &&- grep xyzzy actual &&- grep alternate actual+ test_grep xyzzy actual &&+ test_grep alternate actual ' test_expect_success 'git log --no-notes resets default state' ' git log -1 --notes --notes=alternate \ --no-notes --notes=alternate \ >actual &&- ! grep xyzzy actual &&- grep alternate actual+ test_grep ! xyzzy actual &&+ test_grep alternate actual ' test_expect_success 'git log --no-notes resets ref list' ' git log -1 --notes --notes=alternate \ --no-notes --notes \ >actual &&- grep xyzzy actual &&- ! grep alternate actual+ test_grep xyzzy actual &&+ test_grep ! alternate actual ' test_expect_success 'show -m notes' '@@ -543,7 +543,7 @@ test_expect_success 'list notes with "git notes"' ' test_expect_success '"git notes" without subcommand does not take arguments' ' test_expect_code 129 git notes HEAD^^ 2>err &&- grep "^error: unknown subcommand" err+ test_grep "^error: unknown subcommand" err ' test_expect_success 'list specific note with "git notes list <object>"' '@@ -1464,7 +1464,7 @@ test_expect_success 'GIT_NOTES_REWRITE_REF overrides config' ' GIT_NOTES_REWRITE_REF=refs/notes/commits \ git notes copy --for-rewrite=foo <copy && git log -1 >actual &&- grep "replacement note 3" actual+ test_grep "replacement note 3" actual ' test_expect_success 'git notes copy diagnoses too many or too few arguments' '
index 96243b7222..9a2c3ac3f7 100755--- a/t/t3320-notes-merge-worktrees.sh+++ b/t/t3320-notes-merge-worktrees.sh@@ -67,7 +67,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' ' git config core.notesRef refs/notes/x && test_must_fail git notes merge z >out 2>&1 && test_grep "Automatic notes merge failed" out &&- grep -v "A notes merge into refs/notes/x is already in-progress in" out+ test_grep -v "A notes merge into refs/notes/x is already in-progress in" out ) && echo "refs/notes/x" >expect && git -C worktree2 symbolic-ref NOTES_MERGE_REF >actual &&
t/t3400-rebase.sh
+8-8
index c0c00fbb7b..e62e07b894 100755--- a/t/t3400-rebase.sh+++ b/t/t3400-rebase.sh@@ -287,16 +287,16 @@ test_expect_success 'rebase commit with an ancient timestamp' ' git commit --date="@34567 +0600" -m "Old three" && git cat-file commit HEAD^^ >actual &&- grep "author .* 12345 +0400$" actual &&+ test_grep "author .* 12345 +0400$" actual && git cat-file commit HEAD^ >actual &&- grep "author .* 23456 +0500$" actual &&+ test_grep "author .* 23456 +0500$" actual && git cat-file commit HEAD >actual &&- grep "author .* 34567 +0600$" actual &&+ test_grep "author .* 34567 +0600$" actual && git rebase --onto HEAD^^ HEAD^ && git cat-file commit HEAD >actual &&- grep "author .* 34567 +0600$" actual+ test_grep "author .* 34567 +0600$" actual ' test_expect_success 'rebase with "From " line in commit message' '@@ -333,7 +333,7 @@ test_expect_success 'rebase --apply and --show-current-patch' ' git tag two && test_must_fail git rebase --apply -f --onto init HEAD^ && GIT_TRACE=1 git rebase --show-current-patch >/dev/null 2>stderr &&- grep "show.*$(git rev-parse two)" stderr+ test_grep "show.*$(git rev-parse two)" stderr ) '@@ -364,12 +364,12 @@ test_expect_success 'rebase --apply and .gitattributes' ' git checkout test && git rebase main &&- grep "smudged" a.txt &&+ test_grep "smudged" a.txt && git checkout removal && git reset --hard && git rebase main &&- grep "clean" a.txt+ test_grep "clean" a.txt ) '@@ -386,7 +386,7 @@ test_expect_success 'rebase--merge.sh and --show-current-patch' ' test_must_fail git rebase --merge --onto init HEAD^ && git rebase --show-current-patch >actual.patch && GIT_TRACE=1 git rebase --show-current-patch >/dev/null 2>stderr &&- grep "show.*REBASE_HEAD" stderr &&+ test_grep "show.*REBASE_HEAD" stderr && test "$(git rev-parse REBASE_HEAD)" = "$(git rev-parse two)" ) '
t/t3402-rebase-merge.sh
+8-8
index 761de63b6b..41ebcdec9f 100755--- a/t/t3402-rebase-merge.sh+++ b/t/t3402-rebase-merge.sh@@ -84,8 +84,8 @@ test_expect_success 'rebase -Xtheirs' ' echo "AB $T" >> original && git commit -mconflicting original && git rebase -Xtheirs main &&- grep AB original &&- ! grep 11 original+ test_grep AB original &&+ test_grep ! 11 original ' test_expect_success 'rebase -Xtheirs from orphan' '@@ -93,8 +93,8 @@ test_expect_success 'rebase -Xtheirs from orphan' ' echo "AB $T" >> original && git commit -morphan-conflicting original && git rebase -Xtheirs main &&- grep AB original &&- ! grep 11 original+ test_grep AB original &&+ test_grep ! 11 original ' test_expect_success 'merge and rebase should match' '@@ -210,15 +210,15 @@ test_expect_success '--reapply-cherry-picks refrains from reading unneeded blobs git -C client rev-list --objects --all --missing=print >missing_list && MERGE_BASE_BLOB=$(git -C server rev-parse main^^:file.txt) && ADD_11_BLOB=$(git -C server rev-parse main^:file.txt) &&- grep "[?]$MERGE_BASE_BLOB" missing_list &&- grep "[?]$ADD_11_BLOB" missing_list &&+ test_grep "[?]$MERGE_BASE_BLOB" missing_list &&+ test_grep "[?]$ADD_11_BLOB" missing_list && git -C client rebase --merge --reapply-cherry-picks origin/main && # The blob from the merge base had to be fetched, but not "add 11" git -C client rev-list --objects --all --missing=print >missing_list &&- ! grep "[?]$MERGE_BASE_BLOB" missing_list &&- grep "[?]$ADD_11_BLOB" missing_list+ test_grep ! "[?]$MERGE_BASE_BLOB" missing_list &&+ test_grep "[?]$ADD_11_BLOB" missing_list ' test_done
t/t3404-rebase-interactive.sh
+36-36
index 58b3bb0c27..e64816770a 100755--- a/t/t3404-rebase-interactive.sh+++ b/t/t3404-rebase-interactive.sh@@ -144,7 +144,7 @@ test_expect_success 'rebase -i sets work tree properly' ' mkdir subdir && git rebase -x "(cd subdir && git rev-parse --show-toplevel)" HEAD^ \ >actual &&- ! grep "/subdir$" actual+ test_grep ! "/subdir$" actual ' test_expect_success 'rebase -i with the exec command checks tree cleanness' '@@ -196,7 +196,7 @@ test_expect_success 'rebase -i with exec of inexistent command' ' test_must_fail env FAKE_LINES="exec_this-command-does-not-exist 1" \ git rebase -i HEAD^ >actual 2>&1 ) &&- ! grep "Maybe git-rebase is broken" actual+ test_grep ! "Maybe git-rebase is broken" actual ' test_expect_success 'implicit interactive rebase does not invoke sequence editor' '@@ -293,7 +293,7 @@ test_expect_success 'stop on conflicting pick' ' test_expect_success 'show conflicted patch' ' GIT_TRACE=1 git rebase --show-current-patch >/dev/null 2>stderr &&- grep "show.*REBASE_HEAD" stderr &&+ test_grep "show.*REBASE_HEAD" stderr && # the original stopped-sha1 is abbreviated stopped_sha1="$(git rev-parse $(cat ".git/rebase-merge/stopped-sha"))" && test "$(git rev-parse REBASE_HEAD)" = "$stopped_sha1"@@ -326,7 +326,7 @@ test_expect_success 'retain authorship' ' git tag twerp && git rebase -i --onto primary HEAD^ && git show HEAD >actual &&- grep "^Author: Twerp Snog" actual+ test_grep "^Author: Twerp Snog" actual ' test_expect_success 'retain authorship w/ conflicts' '@@ -348,7 +348,7 @@ test_expect_success 'retain authorship w/ conflicts' ' git rebase --continue && test_cmp_rev conflict-a^0 HEAD^ && git show >out &&- grep AttributeMe out+ test_grep AttributeMe out ' test_expect_success 'squash' '@@ -368,7 +368,7 @@ test_expect_success 'squash' ' test_expect_success 'retain authorship when squashing' ' git show HEAD >actual &&- grep "^Author: Twerp Snog" actual+ test_grep "^Author: Twerp Snog" actual ' test_expect_success '--continue tries to commit' '@@ -383,7 +383,7 @@ test_expect_success '--continue tries to commit' ' ) && test_cmp_rev HEAD^ new-branch1 && git show HEAD >actual &&- grep chouette actual+ test_grep chouette actual ' test_expect_success 'verbose flag is heeded, even after --continue' '@@ -393,7 +393,7 @@ test_expect_success 'verbose flag is heeded, even after --continue' ' echo resolved > file1 && git add file1 && git rebase --continue > output &&- grep "^ file1 | 2 +-$" output+ test_grep "^ file1 | 2 +-$" output ' test_expect_success 'multi-squash only fires up editor once' '@@ -422,7 +422,7 @@ test_expect_success 'multi-fixup does not fire up editor' ' ) && test $base = $(git rev-parse HEAD^) && git show >output &&- ! grep NEVER output &&+ test_grep ! NEVER output && git checkout @{-1} && git branch -D multi-fixup '@@ -487,9 +487,9 @@ test_expect_success 'squash and fixup generate correct log messages' ' git cat-file commit HEAD | sed -e 1,/^\$/d > actual-squash-fixup && test_cmp expect-squash-fixup actual-squash-fixup && git cat-file commit HEAD@{2} >actual &&- grep "^# This is a combination of 3 commits\." actual &&+ test_grep "^# This is a combination of 3 commits\." actual && git cat-file commit HEAD@{3} >actual &&- grep "^# This is a combination of 2 commits\." actual &&+ test_grep "^# This is a combination of 2 commits\." actual && git checkout @{-1} && git branch -D squash-fixup '@@ -593,7 +593,7 @@ test_expect_success '--continue tries to commit, even for "edit"' ' ) && test edited = $(git show HEAD:file7) && git show HEAD >actual &&- grep chouette actual &&+ test_grep chouette actual && test $parent = $(git rev-parse HEAD^) '@@ -779,22 +779,22 @@ test_expect_success 'reword' ' FAKE_LINES="1 2 3 reword 4" FAKE_COMMIT_MESSAGE="E changed" \ git rebase -i A && git show HEAD >actual &&- grep "E changed" actual &&+ test_grep "E changed" actual && test $(git rev-parse primary) != $(git rev-parse HEAD) && test_cmp_rev primary^ HEAD^ && FAKE_LINES="1 2 reword 3 4" FAKE_COMMIT_MESSAGE="D changed" \ git rebase -i A && git show HEAD^ >actual &&- grep "D changed" actual &&+ test_grep "D changed" actual && FAKE_LINES="reword 1 2 3 4" FAKE_COMMIT_MESSAGE="B changed" \ git rebase -i A && git show HEAD~3 >actual &&- grep "B changed" actual &&+ test_grep "B changed" actual && FAKE_LINES="1 r 2 pick 3 p 4" FAKE_COMMIT_MESSAGE="C changed" \ git rebase -i A ) && git show HEAD~2 >actual &&- grep "C changed" actual+ test_grep "C changed" actual ' test_expect_success 'reword fast-forwarded empty commit' '@@ -1043,9 +1043,9 @@ test_expect_success 'rebase -i --root retain root commit author and message' ' FAKE_LINES="2" git rebase -i --root ) && git cat-file commit HEAD >output &&- grep -q "^author Twerp Snog" output &&+ test_grep -q "^author Twerp Snog" output && git cat-file commit HEAD >actual &&- grep -q "^different author$" actual+ test_grep -q "^different author$" actual ' test_expect_success 'rebase -i --root temporary sentinel commit' '@@ -1055,7 +1055,7 @@ test_expect_success 'rebase -i --root temporary sentinel commit' ' test_must_fail env FAKE_LINES="2" git rebase -i --root ) && git cat-file commit HEAD >actual &&- grep "^tree $EMPTY_TREE" actual &&+ test_grep "^tree $EMPTY_TREE" actual && git rebase --abort '@@ -1079,7 +1079,7 @@ test_expect_success 'rebase -i --root reword original root commit' ' git rebase -i --root ) && git show HEAD^ >actual &&- grep "A changed" actual &&+ test_grep "A changed" actual && test -z "$(git show -s --format=%p HEAD^)" '@@ -1092,7 +1092,7 @@ test_expect_success 'rebase -i --root reword new root commit' ' git rebase -i --root ) && git show HEAD^ >actual &&- grep "C changed" actual &&+ test_grep "C changed" actual && test -z "$(git show -s --format=%p HEAD^)" '@@ -1315,11 +1315,11 @@ test_expect_success 'short commit ID collide' ' FAKE_COMMIT_MESSAGE="collide2 $(test_oid t3404_collider)" \ FAKE_LINES="reword 1 break 2" git rebase -i HEAD~2 && test $colliding_id = "$(git rev-parse HEAD | cut -c 1-4)" &&- grep "^pick $colliding_id " \+ test_grep "^pick $colliding_id " \ .git/rebase-merge/git-rebase-todo.tmp &&- grep -E "^pick [0-9a-f]{$hexsz}" \+ test_grep -E "^pick [0-9a-f]{$hexsz}" \ .git/rebase-merge/git-rebase-todo &&- grep -E "^pick [0-9a-f]{$hexsz}" \+ test_grep -E "^pick [0-9a-f]{$hexsz}" \ .git/rebase-merge/git-rebase-todo.backup && git rebase --continue ) &&@@ -1371,7 +1371,7 @@ test_expect_success 'rebase -i commits that overwrite untracked files (pick)' ' echo changed >file1 && git add file1 && test_must_fail git rebase --continue 2>err &&- grep "error: you have staged changes in your working tree" err &&+ test_grep "error: you have staged changes in your working tree" err && git reset --hard HEAD && git rebase --continue && test_cmp_rev HEAD D &&@@ -1398,7 +1398,7 @@ test_expect_success 'rebase -i commits that overwrite untracked files (squash)' echo changed >file1 && git add file1 && test_must_fail git rebase --continue 2>err &&- grep "error: you have staged changes in your working tree" err &&+ test_grep "error: you have staged changes in your working tree" err && git reset --hard HEAD && git rebase --continue && test $(git cat-file commit HEAD | sed -ne \$p) = I &&@@ -1423,7 +1423,7 @@ test_expect_success 'rebase -i commits that overwrite untracked files (no ff)' ' echo changed >file1 && git add file1 && test_must_fail git rebase --continue 2>err &&- grep "error: you have staged changes in your working tree" err &&+ test_grep "error: you have staged changes in your working tree" err && git reset --hard HEAD && git rebase --continue && test $(git cat-file commit HEAD | sed -ne \$p) = I@@ -1709,15 +1709,15 @@ test_expect_success 'the first command cannot be a fixup' ' set_replace_editor orig && test_must_fail git rebase -i A 2>actual ) &&- grep "cannot .fixup. without a previous commit" actual &&- grep "You can fix this with .git rebase --edit-todo.." actual &&+ test_grep "cannot .fixup. without a previous commit" actual &&+ test_grep "You can fix this with .git rebase --edit-todo.." actual && # verify that the todo list has not been truncated grep -v "^#" .git/rebase-merge/git-rebase-todo >actual && test_cmp orig actual && test_must_fail git rebase --edit-todo 2>actual &&- grep "cannot .fixup. without a previous commit" actual &&- grep "You can fix this with .git rebase --edit-todo.." actual &&+ test_grep "cannot .fixup. without a previous commit" actual &&+ test_grep "You can fix this with .git rebase --edit-todo.." actual && # verify that the todo list has not been truncated grep -v "^#" .git/rebase-merge/git-rebase-todo >actual && test_cmp orig actual@@ -2252,7 +2252,7 @@ test_expect_success '--update-refs: check failed ref update' ' git update-ref refs/heads/second third && test_must_fail git rebase --continue 2>err &&- grep "update_ref failed for ref '\''refs/heads/second'\''" err &&+ test_grep "update_ref failed for ref '\''refs/heads/second'\''" err && q_to_tab >expect <<-\EOF && Updated the following refs with --update-refs:@@ -2283,10 +2283,10 @@ test_expect_success 'bad labels and refs rejected when parsing todo list' ' set_replace_editor todo && test_must_fail git rebase -i HEAD 2>err ) &&- grep "'\''#'\'' is not a valid label" err &&- grep "'\'':invalid'\'' is not a valid label" err &&- grep "'\'':bad'\'' is not a valid refname" err &&- grep "update-ref requires a fully qualified refname e.g. refs/heads/topic" \+ test_grep "'\''#'\'' is not a valid label" err &&+ test_grep "'\'':invalid'\'' is not a valid label" err &&+ test_grep "'\'':bad'\'' is not a valid refname" err &&+ test_grep "update-ref requires a fully qualified refname e.g. refs/heads/topic" \ err && test_path_is_missing execed '
index 02c7acd617..252df28bbf 100755--- a/t/t3602-rm-sparse-checkout.sh+++ b/t/t3602-rm-sparse-checkout.sh@@ -79,8 +79,8 @@ test_expect_success 'do not advice about sparse entries when they do not match t git reset --hard && git sparse-checkout set a && test_must_fail git rm nonexistent 2>stderr &&- grep "fatal: pathspec .nonexistent. did not match any files" stderr &&- ! grep -F -f sparse_error_header stderr+ test_grep "fatal: pathspec .nonexistent. did not match any files" stderr &&+ test_grep ! -F -f sparse_error_header stderr ' test_expect_success 'do not warn about sparse entries when pathspec matches dense entries' '
t/t3705-add-sparse-checkout.sh
+5-5
index 53a4782267..64ad7a2949 100755--- a/t/t3705-add-sparse-checkout.sh+++ b/t/t3705-add-sparse-checkout.sh@@ -149,8 +149,8 @@ test_expect_success 'git add --dry-run --ignore-missing warn on sparse path' ' test_expect_success 'do not advice about sparse entries when they do not match the pathspec' ' setup_sparse_entry && test_must_fail git add nonexistent 2>stderr &&- grep "fatal: pathspec .nonexistent. did not match any files" stderr &&- ! grep -F -f sparse_error_header stderr+ test_grep "fatal: pathspec .nonexistent. did not match any files" stderr &&+ test_grep ! -F -f sparse_error_header stderr ' test_expect_success 'do not warn when pathspec matches dense entries' '@@ -184,19 +184,19 @@ test_expect_success 'git add fails outside of sparse-checkout definition' ' git -c core.autocrlf=input add --sparse sparse_entry 2>stderr && test_must_be_empty stderr && git ls-files --stage >actual &&- grep "^100644 .*sparse_entry\$" actual &&+ test_grep "^100644 .*sparse_entry\$" actual && git add --sparse --chmod=+x sparse_entry 2>stderr && test_must_be_empty stderr && git ls-files --stage >actual &&- grep "^100755 .*sparse_entry\$" actual &&+ test_grep "^100755 .*sparse_entry\$" actual && git reset && # This will print a message over stderr on Windows. git add --sparse --renormalize sparse_entry && git status --porcelain >actual &&- grep "^M sparse_entry\$" actual+ test_grep "^M sparse_entry\$" actual ' test_expect_success 'add obeys advice.updateSparsePath' '
index ecc35aae82..53328b8475 100755--- a/t/t3903-stash.sh+++ b/t/t3903-stash.sh@@ -20,21 +20,21 @@ test_expect_success 'setup' ' test_expect_success 'usage on cmd and subcommand invalid option' ' test_expect_code 129 git stash --invalid-option 2>usage &&- grep "or: git stash" usage &&+ test_grep "or: git stash" usage && test_expect_code 129 git stash push --invalid-option 2>usage &&- ! grep "or: git stash" usage+ test_grep ! "or: git stash" usage ' test_expect_success 'usage on main command -h emits a summary of subcommands' ' test_expect_code 129 git stash -h >usage &&- grep -F "usage: git stash list" usage &&- grep -F "or: git stash show" usage+ test_grep -F "usage: git stash list" usage &&+ test_grep -F "or: git stash show" usage ' test_expect_success 'usage for subcommands should emit subcommand usage' ' test_expect_code 129 git stash push -h >usage &&- grep -F "usage: git stash [push" usage+ test_grep -F "usage: git stash [push" usage ' diff_cmp () {@@ -965,7 +965,7 @@ test_expect_success 'store updates stash ref and reflog' ' test $(git rev-parse stash) = $STASH_ID && git reflog --format=%H stash| grep $STASH_ID && git stash pop &&- grep quux bazzy+ test_grep quux bazzy ' test_expect_success 'handle stash specification with spaces' '@@ -977,7 +977,7 @@ test_expect_success 'handle stash specification with spaces' ' echo cow >file && git stash && git stash apply "stash@{$stamp}" &&- grep pig file+ test_grep pig file ' test_expect_success 'setup stash with index and worktree changes' '@@ -1500,9 +1500,9 @@ test_expect_success 'stash export can accept specified stashes' ' test_expect_success 'stash export rejects invalid arguments' ' test_must_fail git stash export --print --to-ref refs/heads/invalid 2>err &&- grep "exactly one of --print and --to-ref is required" err &&+ test_grep "exactly one of --print and --to-ref is required" err && test_must_fail git stash export 2>err2 &&- grep "exactly one of --print and --to-ref is required" err2+ test_grep "exactly one of --print and --to-ref is required" err2 ' test_expect_success 'stash can import and export zero stashes' '@@ -1519,7 +1519,7 @@ test_expect_success 'stash rejects invalid attempts to import commits' ' git stash import foo && test_must_fail git stash import HEAD 2>output && oid=$(git rev-parse HEAD) &&- grep "$oid is not a valid exported stash commit" output &&+ test_grep "$oid is not a valid exported stash commit" output && test_cmp_rev stash@{0} t-stash0 && git checkout --orphan orphan &&@@ -1527,7 +1527,7 @@ test_expect_success 'stash rejects invalid attempts to import commits' ' git update-ref refs/heads/orphan "$(cat fake-commit)" && oid=$(git rev-parse HEAD) && test_must_fail git stash import orphan 2>output &&- grep "found stash commit $oid without expected prefix" output &&+ test_grep "found stash commit $oid without expected prefix" output && test_cmp_rev stash@{0} t-stash0 && git checkout --orphan orphan2 &&@@ -1535,7 +1535,7 @@ test_expect_success 'stash rejects invalid attempts to import commits' ' git update-ref refs/heads/orphan2 "$(cat fake-commit)" && oid=$(git rev-parse HEAD) && test_must_fail git stash import orphan2 2>output &&- grep "found root commit $oid with invalid data" output &&+ test_grep "found root commit $oid with invalid data" output && test_cmp_rev stash@{0} t-stash0 '@@ -1741,7 +1741,7 @@ test_expect_success 'submodules does not affect the branch recorded in stash mes git stash push -m "custom stash for work_branch" && git stash list >../actual_stash_list.txt &&- grep "On work_branch: custom stash for work_branch" ../actual_stash_list.txt+ test_grep "On work_branch: custom stash for work_branch" ../actual_stash_list.txt ) '@@ -1751,7 +1751,7 @@ test_expect_success SANITIZE_LEAK 'stash show handles -- without leaking' ' test_expect_success 'controlled error return on unrecognized option' ' test_expect_code 129 git stash show -p --invalid 2>usage &&- grep -e "^usage: git stash show" usage+ test_grep -e "^usage: git stash show" usage ' test_expect_success 'stash.index=true implies --index' '
t/t3904-stash-patch.sh
+2-2
index 90a4ff2c10..adc45c7073 100755--- a/t/t3904-stash-patch.sh+++ b/t/t3904-stash-patch.sh@@ -103,8 +103,8 @@ test_expect_success 'stash -p with split hunk' ' printf "%s\n" s n y q | git stash -p 2>error && test_must_be_empty error &&- grep "added line 1" test &&- ! grep "added line 2" test+ test_grep "added line 1" test &&+ test_grep ! "added line 2" test ' test_expect_success 'stash -p not confused by GIT_PAGER_IN_USE' '
index 32b14e3a71..74dec7d34a 100755--- a/t/t4000-diff-format.sh+++ b/t/t4000-diff-format.sh@@ -84,7 +84,7 @@ test_expect_success 'git diff-files --no-patch --patch shows the patch' ' test_expect_success 'git diff-files --no-patch --patch-with-raw shows the patch and raw data' ' git diff-files --no-patch --patch-with-raw >actual &&- grep -q "^:100644 100755 .* $ZERO_OID M path0\$" actual &&+ test_grep -q "^:100644 100755 .* $ZERO_OID M path0\$" actual && tail -n +4 actual >actual-patch && compare_diff_patch expected actual-patch '
t/t4001-diff-rename.sh
+2-2
index 4f520d600d..ad474100af 100755--- a/t/t4001-diff-rename.sh+++ b/t/t4001-diff-rename.sh@@ -189,7 +189,7 @@ test_expect_success 'setup for many rename source candidates' ' M path1 EOF test_cmp expect actual.munged &&- grep warning actual.err+ test_grep warning actual.err ' test_expect_success 'rename pretty print with nothing in common' '@@ -258,7 +258,7 @@ test_expect_success 'diff-tree -l0 defaults to a big rename limit, not zero' ' git diff-tree -M -l0 HEAD HEAD^ >actual && # Verify that a rename from myotherfile to myfile was detected- grep "myotherfile.*myfile" actual+ test_grep "myotherfile.*myfile" actual ' test_expect_success 'basename similarity vs best similarity' '
index 6fed993ea0..b5c1b6868f 100755--- a/t/t4022-diff-rewrite.sh+++ b/t/t4022-diff-rewrite.sh@@ -58,13 +58,13 @@ test_expect_success 'suppress deletion diff with -D' ' test_expect_success 'show deletion diff with -B' ' git diff -B -- test >actual &&- grep "Linus Torvalds" actual+ test_grep "Linus Torvalds" actual ' test_expect_success 'suppress deletion diff with -B -D' ' git diff -B -D -- test >actual &&- grep -v "Linus Torvalds" actual+ test_grep -v "Linus Torvalds" actual ' test_expect_success 'prepare a file that ends with an incomplete line' '@@ -82,19 +82,19 @@ test_expect_success 'rewrite the middle 90% of sequence file and terminate with test_expect_success 'confirm that sequence file is considered a rewrite' ' git diff -B seq >res &&- grep "dissimilarity index" res+ test_grep "dissimilarity index" res ' test_expect_success 'no newline at eof is on its own line without -B' ' git diff seq >res &&- grep "^\\\\ " res &&- ! grep "^..*\\\\ " res+ test_grep "^\\\\ " res &&+ test_grep ! "^..*\\\\ " res ' test_expect_success 'no newline at eof is on its own line with -B' ' git diff -B seq >res &&- grep "^\\\\ " res &&- ! grep "^..*\\\\ " res+ test_grep "^\\\\ " res &&+ test_grep ! "^..*\\\\ " res ' test_done
index 2ce26e585c..e11b711388 100755--- a/t/t4038-diff-combined.sh+++ b/t/t4038-diff-combined.sh@@ -100,7 +100,7 @@ test_expect_success 'diagnose truncated file' ' git add file && git commit --amend -C HEAD && git show >out &&- grep "diff --cc file" out+ test_grep "diff --cc file" out ' test_expect_success 'setup for --cc --raw' '@@ -118,13 +118,13 @@ test_expect_success 'check --cc --raw with four trees' ' four_trees=$(echo "$trees" | sed -e 4q) && git diff --cc --raw $four_trees $base_tree >out && # Check for four leading colons in the output:- grep "^::::[^:]" out+ test_grep "^::::[^:]" out ' test_expect_success 'check --cc --raw with forty trees' ' git diff --cc --raw $trees $base_tree >out && # Check for forty leading colons in the output:- grep "^::::::::::::::::::::::::::::::::::::::::[^:]" out+ test_grep "^::::::::::::::::::::::::::::::::::::::::[^:]" out ' test_expect_success 'setup combined ignore spaces' '
t/t4051-diff-function-context.sh
+19-19
index 4838a1df8b..117eaede8a 100755--- a/t/t4051-diff-function-context.sh+++ b/t/t4051-diff-function-context.sh@@ -86,15 +86,15 @@ test_expect_success 'setup' ' check_diff changed_hello 'changed function' test_expect_success ' context includes comment' '- grep "^ .*Hello comment" changed_hello.diff+ test_grep "^ .*Hello comment" changed_hello.diff ' test_expect_success ' context includes begin' '- grep "^ .*Begin of hello" changed_hello.diff+ test_grep "^ .*Begin of hello" changed_hello.diff ' test_expect_success ' context includes end' '- grep "^ .*End of hello" changed_hello.diff+ test_grep "^ .*End of hello" changed_hello.diff ' test_expect_success ' context does not include other functions' '@@ -112,11 +112,11 @@ test_expect_success ' context does not include trailing empty lines' ' check_diff changed_includes 'changed includes' test_expect_success ' context includes begin' '- grep "^ .*Begin.h" changed_includes.diff+ test_grep "^ .*Begin.h" changed_includes.diff ' test_expect_success ' context includes end' '- grep "^ .*End.h" changed_includes.diff+ test_grep "^ .*End.h" changed_includes.diff ' test_expect_success ' context does not include other functions' '@@ -130,11 +130,11 @@ test_expect_success ' context does not include trailing empty lines' ' check_diff appended 'appended function' test_expect_success ' context includes begin' '- grep "^[+].*Begin of first part" appended.diff+ test_grep "^[+].*Begin of first part" appended.diff ' test_expect_success ' context includes end' '- grep "^[+].*End of first part" appended.diff+ test_grep "^[+].*End of first part" appended.diff ' test_expect_success ' context does not include other functions' '@@ -144,11 +144,11 @@ test_expect_success ' context does not include other functions' ' check_diff extended 'appended function part' test_expect_success ' context includes begin' '- grep "^ .*Begin of first part" extended.diff+ test_grep "^ .*Begin of first part" extended.diff ' test_expect_success ' context includes end' '- grep "^[+].*End of second part" extended.diff+ test_grep "^[+].*End of second part" extended.diff ' test_expect_success ' context does not include other functions' '@@ -162,11 +162,11 @@ test_expect_success ' context does not include preceding empty lines' ' check_diff long_common_tail 'change with long common tail and no context' -U0 test_expect_success ' context includes begin' '- grep "^ .*Begin of first part" long_common_tail.diff+ test_grep "^ .*Begin of first part" long_common_tail.diff ' test_expect_success ' context includes end' '- grep "^ .*End of second part" long_common_tail.diff+ test_grep "^ .*End of second part" long_common_tail.diff ' test_expect_success ' context does not include other functions' '@@ -180,13 +180,13 @@ test_expect_success ' context does not include preceding empty lines' ' check_diff changed_hello_appended 'changed function plus appended function' test_expect_success ' context includes begin' '- grep "^ .*Begin of hello" changed_hello_appended.diff &&- grep "^[+].*Begin of first part" changed_hello_appended.diff+ test_grep "^ .*Begin of hello" changed_hello_appended.diff &&+ test_grep "^[+].*Begin of first part" changed_hello_appended.diff ' test_expect_success ' context includes end' '- grep "^ .*End of hello" changed_hello_appended.diff &&- grep "^[+].*End of first part" changed_hello_appended.diff+ test_grep "^ .*End of hello" changed_hello_appended.diff &&+ test_grep "^[+].*End of first part" changed_hello_appended.diff ' test_expect_success ' context does not include other functions' '@@ -196,13 +196,13 @@ test_expect_success ' context does not include other functions' ' check_diff changed_hello_dummy 'changed two consecutive functions' test_expect_success ' context includes begin' '- grep "^ .*Begin of hello" changed_hello_dummy.diff &&- grep "^ .*Begin of dummy" changed_hello_dummy.diff+ test_grep "^ .*Begin of hello" changed_hello_dummy.diff &&+ test_grep "^ .*Begin of dummy" changed_hello_dummy.diff ' test_expect_success ' context includes end' '- grep "^ .*End of hello" changed_hello_dummy.diff &&- grep "^ .*End of dummy" changed_hello_dummy.diff+ test_grep "^ .*End of hello" changed_hello_dummy.diff &&+ test_grep "^ .*End of dummy" changed_hello_dummy.diff ' test_expect_success ' overlapping hunks are merged' '
t/t4053-diff-no-index.sh
+2-2
index 15076dfe0d..8e0394cf5a 100755--- a/t/t4053-diff-no-index.sh+++ b/t/t4053-diff-no-index.sh@@ -283,14 +283,14 @@ test_expect_success "diff --no-index -R treats '-' as stdin" ' test_expect_success 'diff --no-index refuses to diff stdin and a directory' ' test_must_fail git diff --no-index -- - a </dev/null 2>err &&- grep "fatal: cannot compare stdin to a directory" err+ test_grep "fatal: cannot compare stdin to a directory" err ' test_expect_success PIPE 'diff --no-index refuses to diff a named pipe and a directory' ' test_when_finished "rm -f pipe" && mkfifo pipe && test_must_fail git diff --no-index -- pipe a 2>err &&- grep "fatal: cannot compare a named pipe to a directory" err+ test_grep "fatal: cannot compare a named pipe to a directory" err ' test_expect_success PIPE,SYMLINKS 'diff --no-index reads from pipes' '
t/t4063-diff-blobs.sh
+1-1
index 50fdb5ea52..1318cceb19 100755--- a/t/t4063-diff-blobs.sh+++ b/t/t4063-diff-blobs.sh@@ -47,7 +47,7 @@ test_expect_success 'sha1 diff uses arguments as paths' ' check_paths $sha1_one $sha1_two ' test_expect_success 'sha1 diff has no mode change' '- ! grep mode diff+ test_grep ! mode diff ' test_expect_success 'diff by tree:path (run)' '
t/t4065-diff-anchored.sh
+13-13
index b3f510f040..9f06ac65be 100755--- a/t/t4065-diff-anchored.sh+++ b/t/t4065-diff-anchored.sh@@ -10,11 +10,11 @@ test_expect_success '--anchored' ' # normally, c is moved to produce the smallest diff test_expect_code 1 git diff --no-index pre post >diff &&- grep "^+c" diff &&+ test_grep "^+c" diff && # with anchor, a is moved test_expect_code 1 git diff --no-index --anchored=c pre post >diff &&- grep "^+a" diff+ test_grep "^+a" diff ' test_expect_success '--anchored multiple' '@@ -23,13 +23,13 @@ test_expect_success '--anchored multiple' ' # with 1 anchor, c is not moved, but f is moved test_expect_code 1 git diff --no-index --anchored=c pre post >diff &&- grep "^+a" diff && # a is moved instead of c- grep "^+f" diff &&+ test_grep "^+a" diff && # a is moved instead of c+ test_grep "^+f" diff && # with 2 anchors, c and f are not moved test_expect_code 1 git diff --no-index --anchored=c --anchored=f pre post >diff &&- grep "^+a" diff &&- grep "^+d" diff # d is moved instead of f+ test_grep "^+a" diff &&+ test_grep "^+d" diff # d is moved instead of f ' test_expect_success '--anchored with nonexistent line has no effect' '@@ -37,7 +37,7 @@ test_expect_success '--anchored with nonexistent line has no effect' ' printf "c\na\nb\n" >post && test_expect_code 1 git diff --no-index --anchored=x pre post >diff &&- grep "^+c" diff+ test_grep "^+c" diff ' test_expect_success '--anchored with non-unique line has no effect' '@@ -45,7 +45,7 @@ test_expect_success '--anchored with non-unique line has no effect' ' printf "c\na\nb\nc\nd\ne\n" >post && test_expect_code 1 git diff --no-index --anchored=c pre post >diff &&- grep "^+c" diff+ test_grep "^+c" diff ' test_expect_success 'diff still produced with impossible multiple --anchored' '@@ -66,16 +66,16 @@ test_expect_success 'later algorithm arguments override earlier ones' ' printf "c\na\nb\n" >post && test_expect_code 1 git diff --no-index --patience --anchored=c pre post >diff &&- grep "^+a" diff &&+ test_grep "^+a" diff && test_expect_code 1 git diff --no-index --anchored=c --patience pre post >diff &&- grep "^+c" diff &&+ test_grep "^+c" diff && test_expect_code 1 git diff --no-index --histogram --anchored=c pre post >diff &&- grep "^+a" diff &&+ test_grep "^+a" diff && test_expect_code 1 git diff --no-index --anchored=c --histogram pre post >diff &&- grep "^+c" diff+ test_grep "^+c" diff ' test_expect_success '--anchored works with other commands like "git show"' '@@ -88,7 +88,7 @@ test_expect_success '--anchored works with other commands like "git show"' ' # with anchor, a is moved git show --patience --anchored=c >diff &&- grep "^+a" diff+ test_grep "^+a" diff ' test_done
t/t4067-diff-partial-clone.sh
+6-6
index 30813109ac..142abdf74a 100755--- a/t/t4067-diff-partial-clone.sh+++ b/t/t4067-diff-partial-clone.sh@@ -70,9 +70,9 @@ test_expect_success 'diff skips same-OID blobs' ' # Ensure that only a and another-a are fetched. GIT_TRACE_PACKET="$(pwd)/trace" git -C client diff HEAD^ HEAD &&- grep "want $(cat hash-old-a)" trace &&- grep "want $(cat hash-new-a)" trace &&- ! grep "want $(cat hash-b)" trace+ test_grep "want $(cat hash-old-a)" trace &&+ test_grep "want $(cat hash-new-a)" trace &&+ test_grep ! "want $(cat hash-b)" trace ' test_expect_success 'when fetching missing objects, diff skips GITLINKs' '@@ -103,8 +103,8 @@ test_expect_success 'when fetching missing objects, diff skips GITLINKs' ' # Ensure that a and another-a are fetched, and check (by successful # execution of the diff) that no invalid OIDs are sent. GIT_TRACE_PACKET="$(pwd)/trace" git -C client diff HEAD^ HEAD &&- grep "want $(cat hash-old-a)" trace &&- grep "want $(cat hash-new-a)" trace+ test_grep "want $(cat hash-old-a)" trace &&+ test_grep "want $(cat hash-new-a)" trace ' test_expect_success 'diff with rename detection batches blobs' '@@ -127,7 +127,7 @@ test_expect_success 'diff with rename detection batches blobs' ' # Ensure that there is exactly 1 negotiation by checking that there is # only 1 "done" line sent. ("done" marks the end of negotiation.) GIT_TRACE_PACKET="$(pwd)/trace" git -C client diff --raw -M HEAD^ HEAD >out &&- grep ":100644 100644.*R[0-9][0-9][0-9].*b.*c" out &&+ test_grep ":100644 100644.*R[0-9][0-9][0-9].*b.*c" out && grep "fetch> done" trace >done_lines && test_line_count = 1 done_lines '
t/t4073-diff-stat-name-width.sh
+12-12
index ec5d3c3c1f..2412420645 100755--- a/t/t4073-diff-stat-name-width.sh+++ b/t/t4073-diff-stat-name-width.sh@@ -21,41 +21,41 @@ test_expect_success 'setup' ' test_expect_success 'test name-width long enough for filepath' ' git diff HEAD~1 HEAD --stat --stat-name-width=12 >out &&- grep "d你好/f再见 |" out &&+ test_grep "d你好/f再见 |" out && git diff HEAD~1 HEAD --stat --stat-name-width=11 >out &&- grep "d你好/f再见 |" out+ test_grep "d你好/f再见 |" out ' test_expect_success 'test name-width not long enough for dir name' ' git diff HEAD~1 HEAD --stat --stat-name-width=10 >out &&- grep ".../f再见 |" out &&+ test_grep ".../f再见 |" out && git diff HEAD~1 HEAD --stat --stat-name-width=9 >out &&- grep ".../f再见 |" out+ test_grep ".../f再见 |" out ' test_expect_success 'test name-width not long enough for slash' ' git diff HEAD~1 HEAD --stat --stat-name-width=8 >out &&- grep "...f再见 |" out+ test_grep "...f再见 |" out ' test_expect_success 'test name-width not long enough for file name' ' git diff HEAD~1 HEAD --stat --stat-name-width=7 >out &&- grep "...再见 |" out &&+ test_grep "...再见 |" out && git diff HEAD~1 HEAD --stat --stat-name-width=6 >out &&- grep "...见 |" out &&+ test_grep "...见 |" out && git diff HEAD~1 HEAD --stat --stat-name-width=5 >out &&- grep "...见 |" out &&+ test_grep "...见 |" out && git diff HEAD~1 HEAD --stat --stat-name-width=4 >out &&- grep "... |" out+ test_grep "... |" out ' test_expect_success 'test name-width minimum length' ' git diff HEAD~1 HEAD --stat --stat-name-width=3 >out &&- grep "... |" out &&+ test_grep "... |" out && git diff HEAD~1 HEAD --stat --stat-name-width=2 >out &&- grep "... |" out &&+ test_grep "... |" out && git diff HEAD~1 HEAD --stat --stat-name-width=1 >out &&- grep "... |" out+ test_grep "... |" out ' test_done
index 205d86d05e..4c487fb576 100755--- a/t/t4124-apply-ws-rule.sh+++ b/t/t4124-apply-ws-rule.sh@@ -222,8 +222,8 @@ test_expect_success 'trailing whitespace & no newline at the end of file' ' >target && create_patch >patch-file && git apply --whitespace=fix patch-file &&- grep "newline$" target &&- grep "^$" target+ test_grep "newline$" target &&+ test_grep "^$" target ' test_expect_success 'blank at EOF with --whitespace=fix (1)' '@@ -287,7 +287,7 @@ test_expect_success 'blank at EOF with --whitespace=warn' ' git checkout one && git apply --whitespace=warn patch 2>error && test_cmp expect one &&- grep "new blank line at EOF" error+ test_grep "new blank line at EOF" error ' test_expect_success 'blank at EOF with --whitespace=error' '@@ -300,7 +300,7 @@ test_expect_success 'blank at EOF with --whitespace=error' ' git checkout one && test_must_fail git apply --whitespace=error patch 2>error && test_cmp expect one &&- grep "new blank line at EOF" error+ test_grep "new blank line at EOF" error ' test_expect_success 'blank but not empty at EOF' '@@ -313,7 +313,7 @@ test_expect_success 'blank but not empty at EOF' ' git checkout one && git apply --whitespace=warn patch 2>error && test_cmp expect one &&- grep "new blank line at EOF" error+ test_grep "new blank line at EOF" error ' test_expect_success 'applying beyond EOF requires one non-blank context line' '
index eac6f7e151..b114a7adf7 100755--- a/t/t4141-apply-too-large.sh+++ b/t/t4141-apply-too-large.sh@@ -16,7 +16,7 @@ test_expect_success EXPENSIVE 'git apply rejects patches that are too large' ' EOF test-tool genzeros } | test_copy_bytes $sz | test_must_fail git apply 2>err &&- grep "patch too large" err+ test_grep "patch too large" err ' test_done
t/t4150-am.sh
+24-24
index 699a81ab5c..61c3ce9018 100755--- a/t/t4150-am.sh+++ b/t/t4150-am.sh@@ -580,7 +580,7 @@ test_expect_success 'am --keep really keeps the subject' ' git am --keep patch4 && test_path_is_missing .git/rebase-apply && git cat-file commit HEAD >actual &&- grep "Re: Re: Re: \[PATCH 1/5 v2\] \[foo\] third" actual+ test_grep "Re: Re: Re: \[PATCH 1/5 v2\] \[foo\] third" actual ' test_expect_success 'am --keep-non-patch really keeps the non-patch part' '@@ -590,7 +590,7 @@ test_expect_success 'am --keep-non-patch really keeps the non-patch part' ' git am --keep-non-patch patch4 && test_path_is_missing .git/rebase-apply && git cat-file commit HEAD >actual &&- grep "^\[foo\] third" actual+ test_grep "^\[foo\] third" actual ' test_expect_success 'setup am -3' '@@ -642,7 +642,7 @@ test_expect_success 'am with config am.threeWay overridden by --no-3way' ' ' test_expect_success 'am can rename a file' '- grep "^rename from" rename.patch &&+ test_grep "^rename from" rename.patch && rm -fr .git/rebase-apply && git reset --hard && git checkout lorem^0 &&@@ -653,7 +653,7 @@ test_expect_success 'am can rename a file' ' ' test_expect_success 'am -3 can rename a file' '- grep "^rename from" rename.patch &&+ test_grep "^rename from" rename.patch && rm -fr .git/rebase-apply && git reset --hard && git checkout lorem^0 &&@@ -664,7 +664,7 @@ test_expect_success 'am -3 can rename a file' ' ' test_expect_success 'am -3 can rename a file after falling back to 3-way merge' '- grep "^rename from" rename-add.patch &&+ test_grep "^rename from" rename-add.patch && rm -fr .git/rebase-apply && git reset --hard && git checkout lorem^0 &&@@ -884,7 +884,7 @@ test_expect_success 'am --ignore-date' ' git am --ignore-date patch1 && git cat-file commit HEAD | sed -e "/^\$/q" >head1 && sed -ne "/^author /s/.*> //p" head1 >at &&- grep "+0000" at+ test_grep "+0000" at ' test_expect_success 'am into an unborn branch' '@@ -1066,7 +1066,7 @@ test_expect_success 'am --patch-format=mboxrd handles mboxrd' ' INPUT_END git commit -F msg && git -c format.mboxrd format-patch --stdout -1 >mboxrd1 &&- grep "^>From could trip up a loose mbox parser" mboxrd1 &&+ test_grep "^>From could trip up a loose mbox parser" mboxrd1 && git checkout -f first && git am --patch-format=mboxrd mboxrd1 && git cat-file commit HEAD | tail -n4 >out &&@@ -1144,21 +1144,21 @@ test_expect_success 'am and .gitattibutes' ' git format-patch --stdout main..HEAD >patches && git reset --hard main && git am patches &&- grep "smudged" a.txt &&+ test_grep "smudged" a.txt && git checkout removal && git reset --hard && git format-patch --stdout main..HEAD >patches && git reset --hard main && git am patches &&- grep "clean" a.txt &&+ test_grep "clean" a.txt && git checkout conflict && git reset --hard && git format-patch --stdout main..HEAD >patches && git reset --hard fourth && test_must_fail git am -3 patches &&- grep "<<<<<<<<<<" a.txt+ test_grep "<<<<<<<<<<" a.txt ) '@@ -1196,13 +1196,13 @@ test_expect_success 'invalid when passing the --empty option alone' ' test_expect_success 'a message without a patch is an error (default)' ' test_when_finished "git am --abort || :" && test_must_fail git am empty-commit.patch >err &&- grep "Patch is empty" err+ test_grep "Patch is empty" err ' test_expect_success 'a message without a patch is an error where an explicit "--empty=stop" is given' ' test_when_finished "git am --abort || :" && test_must_fail git am --empty=stop empty-commit.patch >err &&- grep "Patch is empty." err+ test_grep "Patch is empty." err ' test_expect_success 'a message without a patch will be skipped when "--empty=drop" is given' '@@ -1210,7 +1210,7 @@ test_expect_success 'a message without a patch will be skipped when "--empty=dro git rev-parse empty-commit^ >expected && git rev-parse HEAD >actual && test_cmp expected actual &&- grep "Skipping: empty commit" output+ test_grep "Skipping: empty commit" output ' test_expect_success 'record as an empty commit when meeting e-mail message that lacks a patch' '@@ -1218,15 +1218,15 @@ test_expect_success 'record as an empty commit when meeting e-mail message that test_path_is_missing .git/rebase-apply && git show empty-commit --format="%B" >expected && git show HEAD --format="%B" >actual &&- grep -f actual expected &&- grep "Creating an empty commit: empty commit" output+ test_grep -f actual expected &&+ test_grep "Creating an empty commit: empty commit" output ' test_expect_success 'skip an empty patch in the middle of an am session' ' git checkout empty-commit^ && test_must_fail git am empty-commit.patch >out 2>err &&- grep "Patch is empty." out &&- grep "To record the empty patch as an empty commit, run \"git am --allow-empty\"." err &&+ test_grep "Patch is empty." out &&+ test_grep "To record the empty patch as an empty commit, run \"git am --allow-empty\"." err && git am --skip && test_path_is_missing .git/rebase-apply && git rev-parse empty-commit^ >expected &&@@ -1237,14 +1237,14 @@ test_expect_success 'skip an empty patch in the middle of an am session' ' test_expect_success 'record an empty patch as an empty commit in the middle of an am session' ' git checkout empty-commit^ && test_must_fail git am empty-commit.patch >out 2>err &&- grep "Patch is empty." out &&- grep "To record the empty patch as an empty commit, run \"git am --allow-empty\"." err &&+ test_grep "Patch is empty." out &&+ test_grep "To record the empty patch as an empty commit, run \"git am --allow-empty\"." err && git am --allow-empty >output &&- grep "No changes - recorded it as an empty commit." output &&+ test_grep "No changes - recorded it as an empty commit." output && test_path_is_missing .git/rebase-apply && git show empty-commit --format="%B" >expected && git show HEAD --format="%B" >actual &&- grep -f actual expected+ test_grep -f actual expected ' test_expect_success 'create an non-empty commit when the index IS changed though "--allow-empty" is given' '@@ -1255,7 +1255,7 @@ test_expect_success 'create an non-empty commit when the index IS changed though git am --allow-empty && git show empty-commit --format="%B" >expected && git show HEAD --format="%B" >actual &&- grep -f actual expected &&+ test_grep -f actual expected && git diff HEAD^..HEAD --name-only '@@ -1264,7 +1264,7 @@ test_expect_success 'cannot create empty commits when there is a clean index due git rev-parse HEAD >expected && test_must_fail git am seq.patch && test_must_fail git am --allow-empty >err &&- ! grep "To record the empty patch as an empty commit, run \"git am --allow-empty\"." err &&+ test_grep ! "To record the empty patch as an empty commit, run \"git am --allow-empty\"." err && git rev-parse HEAD >actual && test_cmp actual expected '@@ -1274,7 +1274,7 @@ test_expect_success 'cannot create empty commits when there is unmerged index du git rev-parse HEAD >expected && test_must_fail git am -3 seq.patch && test_must_fail git am --allow-empty >err &&- ! grep "To record the empty patch as an empty commit, run \"git am --allow-empty\"." err &&+ test_grep ! "To record the empty patch as an empty commit, run \"git am --allow-empty\"." err && git rev-parse HEAD >actual && test_cmp actual expected '
index 9f41d56d9a..023fbff546 100755--- a/t/t4201-shortlog.sh+++ b/t/t4201-shortlog.sh@@ -267,7 +267,7 @@ test_expect_success 'shortlog --group=<format> DWIM' ' test_expect_success 'shortlog bogus --group' ' test_must_fail git shortlog --group=bogus HEAD 2>err &&- grep "unknown group type" err+ test_grep "unknown group type" err ' test_expect_success 'trailer idents are split' '
t/t4202-log.sh
+42-42
index 05cee9e41b..6dc134fa8e 100755--- a/t/t4202-log.sh+++ b/t/t4202-log.sh@@ -668,12 +668,12 @@ test_expect_success 'log --graph with merge with log.graphColors' ' test_expect_success 'log --raw --graph -m with merge' ' git log --raw --graph --oneline -m main | head -n 500 >actual &&- grep "initial" actual+ test_grep "initial" actual ' test_expect_success 'diff-tree --graph' ' git diff-tree --graph main^ | head -n 500 >actual &&- grep "one" actual+ test_grep "one" actual ' cat > expect <<\EOF@@ -1082,13 +1082,13 @@ test_expect_success 'decorate-refs and simplify-by-decoration without output' ' test_expect_success 'decorate-refs-exclude HEAD' ' git log --decorate=full --oneline \ --decorate-refs-exclude="HEAD" >actual &&- ! grep HEAD actual+ test_grep ! HEAD actual ' test_expect_success 'decorate-refs focus from default' ' git log --decorate=full --oneline \ --decorate-refs="refs/heads" >actual &&- ! grep HEAD actual+ test_grep ! HEAD actual ' test_expect_success '--clear-decorations overrides defaults' '@@ -2055,45 +2055,45 @@ test_expect_success GPGSSH 'log ssh key fingerprint' ' test_expect_success GPG 'log --graph --show-signature' ' git log --graph --show-signature -n1 signed >actual &&- grep "^| gpg: Signature made" actual &&- grep "^| gpg: Good signature" actual+ test_grep "^| gpg: Signature made" actual &&+ test_grep "^| gpg: Good signature" actual ' test_expect_success GPGSM 'log --graph --show-signature x509' ' git log --graph --show-signature -n1 signed-x509 >actual &&- grep "^| gpgsm: Signature made" actual &&- grep "^| gpgsm: Good signature" actual+ test_grep "^| gpgsm: Signature made" actual &&+ test_grep "^| gpgsm: Good signature" actual ' test_expect_success GPGSSH 'log --graph --show-signature ssh' ' test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" && git log --graph --show-signature -n1 signed-ssh >actual &&- grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual+ test_grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual ' test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'log shows failure on expired signature key' ' test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" && git log --graph --show-signature -n1 expired-signed >actual &&- ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual+ test_grep ! "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual ' test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'log shows failure on not yet valid signature key' ' test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" && git log --graph --show-signature -n1 notyetvalid-signed >actual &&- ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual+ test_grep ! "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual ' test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'log show success with commit date and key validity matching' ' test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" && git log --graph --show-signature -n1 timeboxedvalid-signed >actual &&- grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&- ! grep "${GPGSSH_BAD_SIGNATURE}" actual+ test_grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&+ test_grep ! "${GPGSSH_BAD_SIGNATURE}" actual ' test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'log shows failure with commit date outside of key validity' ' test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" && git log --graph --show-signature -n1 timeboxedinvalid-signed >actual &&- ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual+ test_grep ! "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual ' test_expect_success GPG 'log --graph --show-signature for merged tag' '@@ -2110,9 +2110,9 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' ' git checkout plain && git merge --no-ff -m msg signed_tag && git log --graph --show-signature -n1 plain >actual &&- grep "^|\\\ merged tag" actual &&- grep "^| | gpg: Signature made" actual &&- grep "^| | gpg: Good signature" actual+ test_grep "^|\\\ merged tag" actual &&+ test_grep "^| | gpg: Signature made" actual &&+ test_grep "^| | gpg: Good signature" actual ' test_expect_success GPG 'log --graph --show-signature for merged tag in shallow clone' '@@ -2132,7 +2132,7 @@ test_expect_success GPG 'log --graph --show-signature for merged tag in shallow git clone --depth 1 --no-local . shallow && test_when_finished "rm -rf shallow" && git -C shallow log --graph --show-signature -n1 plain-shallow >actual &&- grep "tag signed_tag_shallow names a non-parent $hash" actual+ test_grep "tag signed_tag_shallow names a non-parent $hash" actual ' test_expect_success GPG 'log --graph --show-signature for merged tag with missing key' '@@ -2149,9 +2149,9 @@ test_expect_success GPG 'log --graph --show-signature for merged tag with missin git checkout plain-nokey && git merge --no-ff -m msg signed_tag_nokey && GNUPGHOME=. git log --graph --show-signature -n1 plain-nokey >actual &&- grep "^|\\\ merged tag" actual &&- grep "^| | gpg: Signature made" actual &&- grep -E "^| | gpg: Can'"'"'t check signature: (public key not found|No public key)" actual+ test_grep "^|\\\ merged tag" actual &&+ test_grep "^| | gpg: Signature made" actual &&+ test_grep -E "^| | gpg: Can'"'"'t check signature: (public key not found|No public key)" actual ' test_expect_success GPG 'log --graph --show-signature for merged tag with bad signature' '@@ -2171,9 +2171,9 @@ test_expect_success GPG 'log --graph --show-signature for merged tag with bad si git checkout plain-bad && git merge --no-ff -m msg "$(cat forged.tag)" && git log --graph --show-signature -n1 plain-bad >actual &&- grep "^|\\\ merged tag" actual &&- grep "^| | gpg: Signature made" actual &&- grep "^| | gpg: BAD signature from" actual+ test_grep "^|\\\ merged tag" actual &&+ test_grep "^| | gpg: Signature made" actual &&+ test_grep "^| | gpg: BAD signature from" actual ' test_expect_success GPG 'log --show-signature for merged tag with GPG failure' '@@ -2192,9 +2192,9 @@ test_expect_success GPG 'log --show-signature for merged tag with GPG failure' ' if ! test_have_prereq VALGRIND then TMPDIR="$(pwd)/bogus" git log --show-signature -n1 plain-fail >actual &&- grep "^merged tag" actual &&- grep "^No signature" actual &&- ! grep "^gpg: Signature made" actual+ test_grep "^merged tag" actual &&+ test_grep "^No signature" actual &&+ test_grep ! "^gpg: Signature made" actual fi '@@ -2214,9 +2214,9 @@ test_expect_success GPGSM 'log --graph --show-signature for merged tag x509' ' git checkout plain-x509 && git merge --no-ff -m msg signed_tag_x509 && git log --graph --show-signature -n1 plain-x509 >actual &&- grep "^|\\\ merged tag" actual &&- grep "^| | gpgsm: Signature made" actual &&- grep "^| | gpgsm: Good signature" actual+ test_grep "^|\\\ merged tag" actual &&+ test_grep "^| | gpgsm: Signature made" actual &&+ test_grep "^| | gpgsm: Good signature" actual ' test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 missing key' '@@ -2235,8 +2235,8 @@ test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 miss git checkout plain-x509-nokey && git merge --no-ff -m msg signed_tag_x509_nokey && GNUPGHOME=. git log --graph --show-signature -n1 plain-x509-nokey >actual &&- grep "^|\\\ merged tag" actual &&- grep -e "^| | gpgsm: certificate not found" \+ test_grep "^|\\\ merged tag" actual &&+ test_grep -e "^| | gpgsm: certificate not found" \ -e "^| | gpgsm: failed to find the certificate: Not found" actual '@@ -2259,35 +2259,35 @@ test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 bad git checkout plain-x509-bad && git merge --no-ff -m msg "$(cat forged.tag)" && git log --graph --show-signature -n1 plain-x509-bad >actual &&- grep "^|\\\ merged tag" actual &&- grep "^| | gpgsm: Signature made" actual &&- grep "^| | gpgsm: invalid signature" actual+ test_grep "^|\\\ merged tag" actual &&+ test_grep "^| | gpgsm: Signature made" actual &&+ test_grep "^| | gpgsm: invalid signature" actual ' test_expect_success GPG '--no-show-signature overrides --show-signature' ' git log -1 --show-signature --no-show-signature signed >actual &&- ! grep "^gpg:" actual+ test_grep ! "^gpg:" actual ' test_expect_success GPG 'log.showsignature=true behaves like --show-signature' ' test_config log.showsignature true && git log -1 signed >actual &&- grep "gpg: Signature made" actual &&- grep "gpg: Good signature" actual+ test_grep "gpg: Signature made" actual &&+ test_grep "gpg: Good signature" actual ' test_expect_success GPG '--no-show-signature overrides log.showsignature=true' ' test_config log.showsignature true && git log -1 --no-show-signature signed >actual &&- ! grep "^gpg:" actual+ test_grep ! "^gpg:" actual ' test_expect_success GPG '--show-signature overrides log.showsignature=false' ' test_config log.showsignature false && git log -1 --show-signature signed >actual &&- grep "gpg: Signature made" actual &&- grep "gpg: Good signature" actual+ test_grep "gpg: Signature made" actual &&+ test_grep "gpg: Good signature" actual ' test_expect_success 'log --graph --no-walk is forbidden' '@@ -2383,7 +2383,7 @@ test_expect_success 'log --decorate does not include things outside filter' ' git log --decorate=full --oneline >actual && # None of the refs are visible:- ! grep /fake actual+ test_grep ! /fake actual ' test_expect_success 'log --end-of-options' '
t/t4204-patch-id.sh
+1-1
index 605faea0c7..90e661fe98 100755--- a/t/t4204-patch-id.sh+++ b/t/t4204-patch-id.sh@@ -44,7 +44,7 @@ test_expect_success 'setup' ' test_expect_success 'patch-id output is well-formed' ' git log -p -1 >log.output && git patch-id <log.output >output &&- grep "^$OID_REGEX $(git rev-parse HEAD)$" output+ test_grep "^$OID_REGEX $(git rev-parse HEAD)$" output ' #calculate patch id. Make sure output is not empty.
t/t4205-log-pretty-formats.sh
+1-1
index 3865f6abc7..4be5c51489 100755--- a/t/t4205-log-pretty-formats.sh+++ b/t/t4205-log-pretty-formats.sh@@ -535,7 +535,7 @@ test_expect_success 'strbuf_utf8_replace() not producing NUL' ' git log --color --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)%C(auto)%d" | test_decode_color | nul_to_q >actual &&- ! grep Q actual+ test_grep ! Q actual ' # --date=[XXX] and corresponding %a[X] %c[X] format equivalency
t/t4209-log-pickaxe.sh
+5-5
index 0e2f80a268..802597efc7 100755--- a/t/t4209-log-pickaxe.sh+++ b/t/t4209-log-pickaxe.sh@@ -64,21 +64,21 @@ test_expect_success 'usage' ' test_grep "switch.*requires a value" err && test_expect_code 128 git log -Gregex -Sstring 2>err &&- grep "cannot be used together" err &&+ test_grep "cannot be used together" err && test_expect_code 128 git log -Gregex --find-object=HEAD 2>err &&- grep "cannot be used together" err &&+ test_grep "cannot be used together" err && test_expect_code 128 git log -Sstring --find-object=HEAD 2>err &&- grep "cannot be used together" err &&+ test_grep "cannot be used together" err && test_expect_code 128 git log --pickaxe-all --find-object=HEAD 2>err &&- grep "cannot be used together" err+ test_grep "cannot be used together" err ' test_expect_success 'usage: --pickaxe-regex' ' test_expect_code 128 git log -Gregex --pickaxe-regex 2>err &&- grep "cannot be used together" err+ test_grep "cannot be used together" err ' test_expect_success 'usage: --no-pickaxe-regex' '
t/t4211-line-log.sh
+36-36
index ca4eb7bbc7..e61ef9b211 100755--- a/t/t4211-line-log.sh+++ b/t/t4211-line-log.sh@@ -393,14 +393,14 @@ test_expect_success '-L diff output includes index and new file mode' ' git log -L:func2:file.c --format= >actual && # Output should contain index headers (not present in old code path)- grep "^index $head_blob_old\.\.$head_blob_new 100644" actual &&+ test_grep "^index $head_blob_old\.\.$head_blob_new 100644" actual && # Root commit should show new file mode and null index- grep "^new file mode 100644" actual &&- grep "^index $null_blob\.\.$root_blob$" actual &&+ test_grep "^new file mode 100644" actual &&+ test_grep "^index $null_blob\.\.$root_blob$" actual && # Hunk headers should include funcname context- grep "^@@ .* @@ int func1()" actual+ test_grep "^@@ .* @@ int func1()" actual ' test_expect_success '-L with --word-diff' '@@ -431,15 +431,15 @@ test_expect_success '-L with --word-diff' ' test_expect_success '-L with --no-prefix' ' git log -L:func2:file.c --no-prefix --format= >actual &&- grep "^diff --git file.c file.c" actual &&- grep "^--- file.c" actual &&- ! grep "^--- a/" actual+ test_grep "^diff --git file.c file.c" actual &&+ test_grep "^--- file.c" actual &&+ test_grep ! "^--- a/" actual ' test_expect_success '-L with --full-index' ' git log -L:func2:file.c --full-index --format= >actual &&- grep "^index $head_blob_old_full\.\.$head_blob_new_full 100644" actual &&- grep "^index $null_blob_full\.\.$root_blob_full$" actual+ test_grep "^index $head_blob_old_full\.\.$head_blob_new_full 100644" actual &&+ test_grep "^index $null_blob_full\.\.$root_blob_full$" actual ' test_expect_success 'setup -L with whitespace change' '@@ -548,29 +548,29 @@ test_expect_success '-L with --word-diff-regex' ' git log -L:func2:file.c --word-diff \ --word-diff-regex="[a-zA-Z0-9_]+" --format= >actual && # Word-diff markers must be present- grep "{+" actual &&- grep "+}" actual &&+ test_grep "{+" actual &&+ test_grep "+}" actual && # No line-level +/- markers (word-diff replaces them); # exclude --- header lines from the check- ! grep "^+[^+]" actual &&- ! grep "^-[^-]" actual+ test_grep ! "^+[^+]" actual &&+ test_grep ! "^-[^-]" actual ' test_expect_success '-L with --src-prefix and --dst-prefix' ' git checkout parent-oids && git log -L:func2:file.c --src-prefix=old/ --dst-prefix=new/ \ --format= >actual &&- grep "^diff --git old/file.c new/file.c" actual &&- grep "^--- old/file.c" actual &&- grep "^+++ new/file.c" actual &&- ! grep "^--- a/" actual+ test_grep "^diff --git old/file.c new/file.c" actual &&+ test_grep "^--- old/file.c" actual &&+ test_grep "^+++ new/file.c" actual &&+ test_grep ! "^--- a/" actual ' test_expect_success '-L with --abbrev' ' git checkout parent-oids && git log -L:func2:file.c --abbrev=4 --format= -1 >actual && # 4-char abbreviated hashes on index line- grep "^index [0-9a-f]\{4\}\.\.[0-9a-f]\{4\}" actual+ test_grep "^index [0-9a-f]\{4\}\.\.[0-9a-f]\{4\}" actual ' test_expect_success '-L with -b suppresses whitespace-only diff' '@@ -586,24 +586,24 @@ test_expect_success '-L with --output-indicator-*' ' git log -L:func2:file.c --output-indicator-new=">" \ --output-indicator-old="<" --output-indicator-context="|" \ --format= -1 >actual &&- grep "^>" actual &&- grep "^<" actual &&- grep "^|" actual &&+ test_grep "^>" actual &&+ test_grep "^<" actual &&+ test_grep "^|" actual && # No standard +/-/space content markers; exclude ---/+++ headers- ! grep "^+[^+]" actual &&- ! grep "^-[^-]" actual &&- ! grep "^ " actual+ test_grep ! "^+[^+]" actual &&+ test_grep ! "^-[^-]" actual &&+ test_grep ! "^ " actual ' test_expect_success '-L with -R reverses diff' ' git checkout parent-oids && git log -L:func2:file.c -R --format= -1 >actual &&- grep "^diff --git b/file.c a/file.c" actual &&- grep "^--- b/file.c" actual &&- grep "^+++ a/file.c" actual &&+ test_grep "^diff --git b/file.c a/file.c" actual &&+ test_grep "^--- b/file.c" actual &&+ test_grep "^+++ a/file.c" actual && # The modification added "F2 + 2", so reversed it is removed- grep "^-.*F2 + 2" actual &&- grep "^+.*return F2;" actual+ test_grep "^-.*F2 + 2" actual &&+ test_grep "^+.*return F2;" actual ' test_expect_success 'setup for color-moved test' '@@ -629,8 +629,8 @@ test_expect_success '-L with --color-moved' ' --color=always --format= -1 >actual.raw && test_decode_color <actual.raw >actual && # Old moved lines: bold magenta; new moved lines: bold cyan- grep "BOLD;MAGENTA" actual &&- grep "BOLD;CYAN" actual+ test_grep "BOLD;MAGENTA" actual &&+ test_grep "BOLD;CYAN" actual ' test_expect_success 'setup for no-newline-at-eof tests' '@@ -650,14 +650,14 @@ test_expect_success 'setup for no-newline-at-eof tests' ' # newline, the "\ No newline at end of file" marker should appear. test_expect_success '-L no-newline-at-eof appears in tracked range' ' git log -L:bot:noeol.c --format= -1 HEAD~1 >actual &&- grep "No newline at end of file" actual+ test_grep "No newline at end of file" actual ' # When tracking a function that ends before the no-newline content, # the marker should not appear in the output. test_expect_success '-L no-newline-at-eof suppressed outside range' ' git log -L:top:noeol.c --format= >actual &&- ! grep "No newline at end of file" actual+ test_grep ! "No newline at end of file" actual ' # When a commit removes a no-newline last line and replaces it with@@ -665,7 +665,7 @@ test_expect_success '-L no-newline-at-eof suppressed outside range' ' # old side of the diff). test_expect_success '-L no-newline-at-eof marker with deleted line' ' git log -L:bot:noeol.c --format= -1 >actual &&- grep "No newline at end of file" actual+ test_grep "No newline at end of file" actual ' test_expect_success 'setup for range boundary deletion test' '@@ -725,7 +725,7 @@ test_expect_success '-L with -S filters to string-count changes' ' # combined with the -L range walk, this selects commits that # both touch func2 and change the count of "F2 + 2" in the file. test $(grep -c "^diff --git" actual) = 1 &&- grep "F2 + 2" actual+ test_grep "F2 + 2" actual ' test_expect_success '-L with -G filters to diff-text matches' '@@ -735,7 +735,7 @@ test_expect_success '-L with -G filters to diff-text matches' ' # combined with -L, this selects commits that both touch func2 # and have "F2 + 2" in their diff. test $(grep -c "^diff --git" actual) = 1 &&- grep "F2 + 2" actual+ test_grep "F2 + 2" actual ' test_expect_success '-L with --diff-filter=M excludes root commit' '
index 96ddf3c53a..f68b5d3127 100755--- a/t/t4254-am-corrupt.sh+++ b/t/t4254-am-corrupt.sh@@ -73,16 +73,16 @@ test_expect_success "NUL in commit message's body" ' test_when_finished "git am --abort" && make_mbox_with_nul body >body.patch && test_must_fail git am body.patch 2>err &&- grep "a NUL byte in commit log message not allowed" err+ test_grep "a NUL byte in commit log message not allowed" err ' test_expect_success "NUL in commit message's header" " test_when_finished 'git am --abort' && make_mbox_with_nul subject >subject.patch && test_must_fail git mailinfo msg patch <subject.patch 2>err &&- grep \"a NUL byte in 'Subject' is not allowed\" err &&+ test_grep \"a NUL byte in 'Subject' is not allowed\" err && test_must_fail git am subject.patch 2>err &&- grep \"a NUL byte in 'Subject' is not allowed\" err+ test_grep \"a NUL byte in 'Subject' is not allowed\" err " test_done
t/t4258-am-quoted-cr.sh
+1-1
index 201915b45a..50e81b9330 100755--- a/t/t4258-am-quoted-cr.sh+++ b/t/t4258-am-quoted-cr.sh@@ -16,7 +16,7 @@ test_expect_success 'setup' ' test_expect_success 'am warn if quoted-cr is found' ' git reset --hard one && test_must_fail git am "$DATA/mbox" 2>err &&- grep "quoted CRLF detected" err+ test_grep "quoted CRLF detected" err ' test_expect_success 'am --quoted-cr=strip' '
t/t4301-merge-tree-write-tree.sh
+9-9
index 6e117ee93c..b2684911d1 100755--- a/t/t4301-merge-tree-write-tree.sh+++ b/t/t4301-merge-tree-write-tree.sh@@ -88,7 +88,7 @@ test_expect_success 'Clean merge' ' # Repeat the previous test, but turn off rename detection test_expect_success 'Failed merge without rename detection' ' test_must_fail git -c diff.renames=false merge-tree --write-tree side1 side3 >out &&- grep "CONFLICT (modify/delete): numbers deleted" out+ test_grep "CONFLICT (modify/delete): numbers deleted" out ' test_expect_success '--quiet on conflicted merge' '@@ -161,13 +161,13 @@ test_expect_success 'Barf on misspelled option, with exit code other than 0 or 1 # Mis-spell with single "s" instead of double "s" test_expect_code 129 git merge-tree --write-tree --mesages FOOBAR side1 side2 2>expect &&- grep "error: unknown option.*mesages" expect+ test_grep "error: unknown option.*mesages" expect ' test_expect_success 'Barf on too many arguments' ' test_expect_code 129 git merge-tree --write-tree side1 side2 invalid 2>expect &&- grep "^usage: git merge-tree" expect+ test_grep "^usage: git merge-tree" expect ' anonymize_hash() {@@ -352,7 +352,7 @@ test_expect_success 'rename/add handling' ' # hash=$(tr "\0" "\n" <out | head -n 3 | grep 3.bar | cut -f 2 -d " ") && git rev-list --objects --all >all_blobs &&- ! grep $hash all_blobs &&+ test_grep ! $hash all_blobs && # # Second, check anonymized hash output against expectation@@ -419,7 +419,7 @@ test_expect_success SYMLINKS 'rename/add, where add is a mode conflict' ' # hash=$(tr "\0" "\n" <out | head -n 3 | grep 3.bar | cut -f 2 -d " ") && git rev-list --objects --all >all_blobs &&- ! grep $hash all_blobs &&+ test_grep ! $hash all_blobs && # # Second, check anonymized hash output against expectation@@ -670,8 +670,8 @@ test_expect_success 'mod6: chains of rename/rename(1to2) and add/add via collidi hash1=$(tr "\0" "\n" <out | head | grep 2.four | cut -f 2 -d " ") && hash2=$(tr "\0" "\n" <out | head | grep 3.two | cut -f 2 -d " ") && git rev-list --objects --all >all_blobs &&- ! grep $hash1 all_blobs &&- ! grep $hash2 all_blobs &&+ test_grep ! $hash1 all_blobs &&+ test_grep ! $hash2 all_blobs && # # Now compare anonymized hash output with expectation@@ -857,7 +857,7 @@ test_expect_success 'NUL terminated conflicted file "lines"' ' test_expect_success 'error out by default for unrelated histories' ' test_expect_code 128 git merge-tree --write-tree side1 unrelated 2>error &&- grep "refusing to merge unrelated histories" error+ test_grep "refusing to merge unrelated histories" error ' test_expect_success 'can override merge of unrelated histories' '@@ -924,7 +924,7 @@ test_expect_success '--stdin with both a successful and a conflicted merge' ' test_expect_success '--merge-base is incompatible with --stdin' ' test_must_fail git merge-tree --merge-base=side1 --stdin 2>expect &&- grep "^fatal: .*merge-base.*stdin.* cannot be used together" expect+ test_grep "^fatal: .*merge-base.*stdin.* cannot be used together" expect ' # specify merge-base as parent of branch2
t/t5000-tar-tree.sh
+5-5
index a8c28533dc..3ad600c793 100755--- a/t/t5000-tar-tree.sh+++ b/t/t5000-tar-tree.sh@@ -323,14 +323,14 @@ test_expect_success 'setup tar filters' ' test_expect_success 'archive --list mentions user filter' ' git archive --list >output &&- grep "^tar\.foo\$" output &&- grep "^bar\$" output+ test_grep "^tar\.foo\$" output &&+ test_grep "^bar\$" output ' test_expect_success 'archive --list shows only enabled remote filters' ' git archive --list --remote=. >output &&- ! grep "^tar\.foo\$" output &&- grep "^bar\$" output+ test_grep ! "^tar\.foo\$" output &&+ test_grep "^bar\$" output ' test_expect_success 'invoke tar filter by format' '@@ -440,7 +440,7 @@ test_expect_success 'catch non-matching pathspec' ' test_expect_success 'reject paths outside the current directory' ' test_must_fail git -C a/bin archive HEAD .. >/dev/null 2>err &&- grep "outside the current directory" err+ test_grep "outside the current directory" err ' test_expect_success 'allow pathspecs that resolve to the current directory' '
index 270ce6ea48..67c5dc7e85 100755--- a/t/t5150-request-pull.sh+++ b/t/t5150-request-pull.sh@@ -130,8 +130,8 @@ test_expect_success 'pull request when forgot to push' ' test_must_fail git request-pull initial "$downstream_url" \ 2>../err ) &&- grep "No match for commit .*" err &&- grep "Are you sure you pushed" err+ test_grep "No match for commit .*" err &&+ test_grep "Are you sure you pushed" err '@@ -230,7 +230,7 @@ test_expect_success 'pull request format' ' cd local && git request-pull initial "$downstream_url" full ) >request &&- grep " tags/full\$" request+ test_grep " tags/full\$" request ' test_expect_success 'request-pull ignores OPTIONS_KEEPDASHDASH poison' '@@ -260,8 +260,8 @@ test_expect_success 'request-pull quotes regex metacharacters properly' ' test_must_fail git request-pull initial "$downstream_url" tags/v2.0 \ 2>../err ) &&- grep "No match for commit .*" err &&- grep "Are you sure you pushed" err+ test_grep "No match for commit .*" err &&+ test_grep "Are you sure you pushed" err '@@ -277,8 +277,8 @@ test_expect_success 'pull request with mismatched object' ' test_must_fail git request-pull initial "$downstream_url" tags/full \ 2>../err ) &&- grep "points to a different object" err &&- grep "Are you sure you pushed" err+ test_grep "points to a different object" err &&+ test_grep "Are you sure you pushed" err '@@ -295,8 +295,8 @@ test_expect_success 'pull request with stale object' ' test_must_fail git request-pull initial "$downstream_url" tags/full \ 2>../err ) &&- grep "points to a different object" err &&- grep "Are you sure you pushed" err+ test_grep "points to a different object" err &&+ test_grep "Are you sure you pushed" err '
index d76eb4be93..7f621c5331 100755--- a/t/t5351-unpack-large-objects.sh+++ b/t/t5351-unpack-large-objects.sh@@ -32,7 +32,7 @@ test_expect_success 'set memory limitation to 1MB' ' test_expect_success 'unpack-objects failed under memory limitation' ' prepare_dest 2m && test_must_fail git -C dest.git unpack-objects <pack-$PACK.pack 2>err &&- grep "fatal: attempting to allocate" err+ test_grep "fatal: attempting to allocate" err ' test_expect_success 'unpack-objects works with memory limitation in dry-run mode' '
t/t5402-post-merge-hook.sh
+2-2
index 915af2de95..c77aa56421 100755--- a/t/t5402-post-merge-hook.sh+++ b/t/t5402-post-merge-hook.sh@@ -46,7 +46,7 @@ test_expect_success 'post-merge runs as expected ' ' ' test_expect_success 'post-merge from normal merge receives the right argument ' '- grep 0 clone1/.git/post-merge.args+ test_grep 0 clone1/.git/post-merge.args ' test_expect_success 'post-merge from squash merge runs as expected ' '@@ -55,7 +55,7 @@ test_expect_success 'post-merge from squash merge runs as expected ' ' ' test_expect_success 'post-merge from squash merge receives the right argument ' '- grep 1 clone2/.git/post-merge.args+ test_grep 1 clone2/.git/post-merge.args ' test_done
t/t5403-post-checkout-hook.sh
+1-1
index cb0300b2d2..39009ce327 100755--- a/t/t5403-post-checkout-hook.sh+++ b/t/t5403-post-checkout-hook.sh@@ -100,7 +100,7 @@ test_rebase () { echo untracked >three.t && test_when_finished "rm three.t" && test_must_fail git rebase $args HEAD rebase-fast-forward 2>err &&- grep "untracked working tree files would be overwritten by checkout" err &&+ test_grep "untracked working tree files would be overwritten by checkout" err && test_path_is_missing .git/post-checkout.args '
index ad7f8c6f00..ed9896e27a 100755--- a/t/t5407-post-rewrite-hook.sh+++ b/t/t5407-post-rewrite-hook.sh@@ -195,19 +195,19 @@ test_expect_success 'git rebase with failed pick' ' set_replace_editor todo && test_must_fail git rebase -i D D 2>err ) &&- grep "would be overwritten" err &&+ test_grep "would be overwritten" err && rm bar && test_must_fail git rebase --continue 2>err &&- grep "would be overwritten" err &&+ test_grep "would be overwritten" err && rm G && test_must_fail git rebase --continue 2>err &&- grep "would be overwritten" err &&+ test_grep "would be overwritten" err && rm H && test_must_fail git rebase --continue 2>err &&- grep "would be overwritten" err &&+ test_grep "would be overwritten" err && rm I && git rebase --continue &&
index 523aff6268..5d79472c39 100755--- a/t/t5514-fetch-multiple.sh+++ b/t/t5514-fetch-multiple.sh@@ -217,7 +217,7 @@ test_expect_success 'parallel' ' test_must_fail env GIT_TRACE="$PWD/trace" \ git fetch --jobs=2 --multiple one two 2>err &&- grep "preparing to run up to 2 tasks" trace &&+ test_grep "preparing to run up to 2 tasks" trace && test_grep "could not fetch .one.*128" err && test_grep "could not fetch .two.*128" err '
t/t5516-fetch-push.sh
+10-10
index 1b986349a8..f3b3efc47f 100755--- a/t/t5516-fetch-push.sh+++ b/t/t5516-fetch-push.sh@@ -124,7 +124,7 @@ do do test_expect_success "reject 'git $cmd --no-$opt'" ' test_must_fail git $cmd --no-$opt 2>err &&- grep "unknown option .no-$opt" err+ test_grep "unknown option .no-$opt" err ' done done@@ -212,7 +212,7 @@ test_expect_success 'push with negotiation' ' GIT_TRACE2_EVENT="$(pwd)/event" \ git -c protocol.version=2 -c push.negotiate=1 \ push testrepo refs/heads/main:refs/remotes/origin/main &&- grep \"key\":\"total_rounds\",\"value\":\"1\" event &&+ test_grep \"key\":\"total_rounds\",\"value\":\"1\" event && grep_wrote 2 event # 1 commit, 1 tree '@@ -250,8 +250,8 @@ test_expect_success 'push with negotiation does not attempt to fetch submodules' GIT_TRACE2_EVENT="$(pwd)/event" git -c submodule.recurse=true \ -c protocol.version=2 -c push.negotiate=1 \ push testrepo refs/heads/main:refs/remotes/origin/main 2>err &&- grep \"key\":\"total_rounds\",\"value\":\"1\" event &&- ! grep "Fetching submodule" err+ test_grep \"key\":\"total_rounds\",\"value\":\"1\" event &&+ test_grep ! "Fetching submodule" err ' test_expect_success 'push with negotiation and remote.<name>.negotiationInclude' '@@ -637,7 +637,7 @@ test_expect_success 'push rejects empty branch name entries' ' test_config branch.main.remote one && test_config branch.main.merge refs/heads/main && test_must_fail git push 2>err &&- grep "bad config variable .branch\.\." err+ test_grep "bad config variable .branch\.\." err ' test_expect_success 'push ignores "branch." config without subsection' '@@ -923,7 +923,7 @@ test_expect_success 'warn on push to HEAD of non-bare repository' ' git config receive.denyCurrentBranch warn ) && git push testrepo main 2>stderr &&- grep "warning: updating the current branch" stderr+ test_grep "warning: updating the current branch" stderr ' test_expect_success 'deny push to HEAD of non-bare repository' '@@ -945,7 +945,7 @@ test_expect_success 'allow push to HEAD of bare repository (bare)' ' git config core.bare true ) && git push testrepo main 2>stderr &&- ! grep "warning: updating the current branch" stderr+ test_grep ! "warning: updating the current branch" stderr ' test_expect_success 'allow push to HEAD of non-bare repository (config)' '@@ -956,7 +956,7 @@ test_expect_success 'allow push to HEAD of non-bare repository (config)' ' git config receive.denyCurrentBranch false ) && git push testrepo main 2>stderr &&- ! grep "warning: updating the current branch" stderr+ test_grep ! "warning: updating the current branch" stderr ' test_expect_success !WITH_BREAKING_CHANGES 'fetch with branches' '@@ -1068,7 +1068,7 @@ test_expect_success 'push into aliased refs (inconsistent)' ' git commit -a -m child2 && git branch bar && test_must_fail git push ../child1 foo bar 2>stderr &&- grep "refusing inconsistent update" stderr+ test_grep "refusing inconsistent update" stderr ) '@@ -1161,7 +1161,7 @@ test_expect_success 'push --porcelain' ' test_expect_success 'push --porcelain bad url' ' mk_empty testrepo && test_must_fail git push >.git/bar --porcelain asdfasdfasd refs/heads/main:refs/remotes/origin/main &&- ! grep -q Done .git/bar+ test_grep ! -q Done .git/bar ' test_expect_success 'push --porcelain rejected' '
t/t5520-pull.sh
+2-2
index 0e0019347e..27f38ab3c8 100755--- a/t/t5520-pull.sh+++ b/t/t5520-pull.sh@@ -356,8 +356,8 @@ test_expect_success '--rebase with rebase.autostash succeeds on ff' ' echo "dirty" >>dst/file && test_config -C dst rebase.autostash true && git -C dst pull --rebase >actual 2>&1 &&- grep -q "Fast-forward" actual &&- grep -q "Applied autostash." actual+ test_grep -q "Fast-forward" actual &&+ test_grep -q "Applied autostash." actual ' test_expect_success '--rebase with conflicts shows advice' '
t/t5524-pull-msg.sh
+3-3
index b2be3605f5..493156a2b8 100755--- a/t/t5524-pull-msg.sh+++ b/t/t5524-pull-msg.sh@@ -31,7 +31,7 @@ test_expect_success pull ' git pull --no-rebase --log && git log -2 && git cat-file commit HEAD >result &&- grep Dollar result+ test_grep Dollar result ) '@@ -44,8 +44,8 @@ test_expect_success '--log=1 limits shortlog length' ' git pull --no-rebase --log=1 && git log -3 && git cat-file commit HEAD >result &&- grep Dollar result &&- ! grep "second commit" result+ test_grep Dollar result &&+ test_grep ! "second commit" result ) '
index 80b06a0cd2..35b1f212a8 100755--- a/t/t5529-push-errors.sh+++ b/t/t5529-push-errors.sh@@ -44,14 +44,14 @@ test_expect_success 'detect missing sha1 expressions early' ' # 'builtin/push.c:set_refspecs()' and we want to test that regression. test_expect_success 'detect empty remote with existing local ref' ' test_must_fail git push "" main 2> stderr &&- grep "fatal: bad repository ${SQ}${SQ}" stderr+ test_grep "fatal: bad repository ${SQ}${SQ}" stderr ' # While similar to the previous test, here we want to ensure that # even targeted refspecs are handled. test_expect_success 'detect empty remote with targeted refspec' ' test_must_fail git push "" HEAD:refs/heads/main 2> stderr &&- grep "fatal: bad repository ${SQ}${SQ}" stderr+ test_grep "fatal: bad repository ${SQ}${SQ}" stderr ' test_expect_success 'detect ambiguous refs early' '
index 05debd1134..7d239dd31f 100755--- a/t/t5531-deep-submodule-push.sh+++ b/t/t5531-deep-submodule-push.sh@@ -559,7 +559,7 @@ test_expect_success 'push with push.recurseSubmodules=only on superproject and t test_must_fail git -C upstream rev-parse refs/heads/downstream-branch && git -C upstream/sub rev-parse refs/heads/downstream-branch && git -C upstream/sub/deepsub rev-parse refs/heads/downstream-branch &&- grep "recursing into submodule with push.recurseSubmodules=only; using on-demand instead" err+ test_grep "recursing into submodule with push.recurseSubmodules=only; using on-demand instead" err ' test_expect_success 'push propagating the remotes name to a submodule' '
index dc0e972943..afab456b32 100755--- a/t/t5538-push-shallow.sh+++ b/t/t5538-push-shallow.sh@@ -65,7 +65,7 @@ test_expect_success 'push from shallow clone, with grafted roots' ' ( cd shallow2 && test_must_fail git push ../.git +main:refs/remotes/shallow2/main 2>err &&- grep "shallow2/main.*shallow update not allowed" err+ test_grep "shallow2/main.*shallow update not allowed" err ) && test_must_fail git rev-parse shallow2/main && git fsck
t/t5539-fetch-http-shallow.sh
+2-2
index 3ea75d34ca..44e6f609df 100755--- a/t/t5539-fetch-http-shallow.sh+++ b/t/t5539-fetch-http-shallow.sh@@ -76,8 +76,8 @@ test_expect_success 'no shallow lines after receiving ACK ready' ' # might be able to run this test in all protocol versions. GIT_TRACE_PACKET="$TRASH_DIRECTORY/trace" GIT_TEST_PROTOCOL_VERSION=0 \ git fetch --depth=2 &&- grep "fetch-pack< ACK .* ready" ../trace &&- ! grep "fetch-pack> done" ../trace+ test_grep "fetch-pack< ACK .* ready" ../trace &&+ test_grep ! "fetch-pack> done" ../trace ) '
t/t5541-http-push-smart.sh
+16-16
index 538b603f03..8c34833027 100755--- a/t/t5541-http-push-smart.sh+++ b/t/t5541-http-push-smart.sh@@ -56,8 +56,8 @@ test_expect_success 'push to remote repository (standard)' ' git commit -m path2 && HEAD=$(git rev-parse --verify HEAD) && GIT_TRACE_CURL=true git push -v -v 2>err &&- ! grep "Expect: 100-continue" err &&- grep "POST git-receive-pack ([0-9]* bytes)" err &&+ test_grep ! "Expect: 100-continue" err &&+ test_grep "POST git-receive-pack ([0-9]* bytes)" err && (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git && test $HEAD = $(git rev-parse --verify HEAD)) '@@ -84,7 +84,7 @@ test_expect_success 'push to remote repository (standard) with sending Accept-La git commit -m path_lang && HEAD=$(git rev-parse --verify HEAD) && GIT_TRACE_CURL=true LANGUAGE="ko_KR.UTF-8" git push -v -v 2>err &&- ! grep "Expect: 100-continue" err &&+ test_grep ! "Expect: 100-continue" err && grep "=> Send header: Accept-Language:" err >err.language && test_cmp exp err.language@@ -148,8 +148,8 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he test_must_fail git push -v origin +main main:niam >output 2>&1' test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: remote output' '- grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *main -> main (forced update)$" output &&- grep "^ ! \[rejected\] *main -> niam (non-fast-forward)$" output+ test_grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *main -> main (forced update)$" output &&+ test_grep "^ ! \[rejected\] *main -> niam (non-fast-forward)$" output ' test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: our output' '@@ -163,7 +163,7 @@ test_expect_success 'push (chunked)' ' HEAD=$(git rev-parse --verify HEAD) && test_config http.postbuffer 4 && git push -v -v origin $BRANCH 2>err &&- grep "POST git-receive-pack (chunked)" err &&+ test_grep "POST git-receive-pack (chunked)" err && (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git && test $HEAD = $(git rev-parse --verify HEAD)) '@@ -215,15 +215,15 @@ test_expect_success 'push --atomic also prevents branch creation, reports collat test_cmp expected actual && # the failed refs should be indicated to the user- grep "^ ! .*rejected.* main -> main" output &&+ test_grep "^ ! .*rejected.* main -> main" output && # the collateral failure refs should be indicated to the user- grep "^ ! .*rejected.* atomic -> atomic .*atomic push failed" output &&- grep "^ ! .*rejected.* collateral -> collateral .*atomic push failed" output &&+ test_grep "^ ! .*rejected.* atomic -> atomic .*atomic push failed" output &&+ test_grep "^ ! .*rejected.* collateral -> collateral .*atomic push failed" output && # never report what we do not push- ! grep "^ ! .*rejected.* atomic1 " output &&- ! grep "^ ! .*rejected.* other " output+ test_grep ! "^ ! .*rejected.* atomic1 " output &&+ test_grep ! "^ ! .*rejected.* other " output ' test_expect_success 'push --atomic fails on server-side errors' '@@ -247,10 +247,10 @@ test_expect_success 'push --atomic fails on server-side errors' ' test_must_fail git -C "$d" show-ref --verify refs/heads/other && # the failed refs should be indicated to the user- grep "^ ! .*rejected.* other -> other .*atomic transaction failed" output &&+ test_grep "^ ! .*rejected.* other -> other .*atomic transaction failed" output && # the collateral failure refs should be indicated to the user- grep "^ ! .*rejected.* atomic -> atomic .*atomic transaction failed" output+ test_grep "^ ! .*rejected.* atomic -> atomic .*atomic transaction failed" output ' test_expect_success 'push --all can push to empty repo' '@@ -442,7 +442,7 @@ test_expect_success 'push status output scrubs password' ' "$HTTPD_URL_USER_PASS/smart/test_repo.git" \ +HEAD:scrub >status && # should have been scrubbed down to vanilla URL- grep "^To $HTTPD_URL/smart/test_repo.git" status+ test_grep "^To $HTTPD_URL/smart/test_repo.git" status ' test_expect_success 'clone/fetch scrubs password from reflogs' '@@ -456,8 +456,8 @@ test_expect_success 'clone/fetch scrubs password from reflogs' ' +main:main && # should have been scrubbed down to vanilla URL git log -g main >reflog &&- grep "$HTTPD_URL" reflog &&- ! grep "$HTTPD_URL_USER_PASS" reflog+ test_grep "$HTTPD_URL" reflog &&+ test_grep ! "$HTTPD_URL_USER_PASS" reflog ' test_expect_success 'Non-ASCII branch name can be used with --force-with-lease' '
t/t5544-pack-objects-hook.sh
+6-6
index 89147a052e..908d3b8ebe 100755--- a/t/t5544-pack-objects-hook.sh+++ b/t/t5544-pack-objects-hook.sh@@ -27,7 +27,7 @@ test_expect_success 'hook runs via global config' ' clear_hook_results && test_config_global uploadpack.packObjectsHook ./hook && git clone --no-local . dst.git 2>stderr &&- grep "hook running" stderr+ test_grep "hook running" stderr ' test_expect_success 'hook outputs are sane' '@@ -38,7 +38,7 @@ test_expect_success 'hook outputs are sane' ' # the full argument list or the exact pack contents, as it would make # the test brittle. So just sanity check that we could replay # the packing procedure.- grep "^git" .git/hook.args &&+ test_grep "^git" .git/hook.args && $(cat .git/hook.args) <.git/hook.stdin >replay '@@ -47,14 +47,14 @@ test_expect_success 'hook runs from -c config' ' git clone --no-local \ -u "git -c uploadpack.packObjectsHook=./hook upload-pack" \ . dst.git 2>stderr &&- grep "hook running" stderr+ test_grep "hook running" stderr ' test_expect_success 'hook does not run from repo config' ' clear_hook_results && test_config uploadpack.packObjectsHook "./hook" && git clone --no-local . dst.git 2>stderr &&- ! grep "hook running" stderr &&+ test_grep ! "hook running" stderr && test_path_is_missing .git/hook.args && test_path_is_missing .git/hook.stdin && test_path_is_missing .git/hook.stdout &&@@ -62,7 +62,7 @@ test_expect_success 'hook does not run from repo config' ' # check that global config is used instead test_config_global uploadpack.packObjectsHook ./hook && git clone --no-local . dst2.git 2>stderr &&- grep "hook running" stderr+ test_grep "hook running" stderr ' test_expect_success 'hook works with partial clone' '@@ -72,7 +72,7 @@ test_expect_success 'hook works with partial clone' ' git clone --bare --no-local --filter=blob:none . dst.git && git -C dst.git rev-list --objects --missing=allow-any --no-object-names --all >objects && git -C dst.git cat-file --batch-check="%(objecttype)" <objects >types &&- ! grep blob types+ test_grep ! blob types ' test_done
t/t5550-http-fetch-dumb.sh
+2-2
index b0080bf204..f00eeae48f 100755--- a/t/t5550-http-fetch-dumb.sh+++ b/t/t5550-http-fetch-dumb.sh@@ -124,7 +124,7 @@ test_expect_success 'netrc authorized but forbidden credentials (fail on 403)' ' set_netrc 127.0.0.1 forbidden-user@host pass@host && test_must_fail git clone "$HTTPD_URL/auth/dumb/repo.git" clone-auth-netrc-403 2>err && expect_askpass none &&- grep "The requested URL returned error: 403" err+ test_grep "The requested URL returned error: 403" err ' test_expect_success 'http auth can use user/pass in URL' '@@ -280,7 +280,7 @@ test_expect_success 'http-fetch --packfile' ' --index-pack-arg=--keep \ "$HTTPD_URL"/dumb/repo_pack.git/$p >out &&- grep -E "^keep.[0-9a-f]{16,}$" out &&+ test_grep -E "^keep.[0-9a-f]{16,}$" out && cut -c6- out >packhash && # Ensure that the expected files are generated
t/t5551-http-fetch-smart.sh
+23-23
index e236e526f0..76d3060fca 100755--- a/t/t5551-http-fetch-smart.sh+++ b/t/t5551-http-fetch-smart.sh@@ -164,8 +164,8 @@ test_expect_success 'fetch changes via http' ' test_expect_success 'used upload-pack service' ' strip_access_log >log &&- grep "GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/[0-9.]* 200" log &&- grep "POST /smart/repo.git/git-upload-pack HTTP/[0-9.]* 200" log+ test_grep "GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/[0-9.]* 200" log &&+ test_grep "POST /smart/repo.git/git-upload-pack HTTP/[0-9.]* 200" log ' test_expect_success 'follow redirects (301)' '@@ -264,8 +264,8 @@ test_expect_success 'GIT_TRACE_CURL redacts auth details' ' # Ensure that there is no "Basic" followed by a base64 string, but that # the auth details are redacted- ! grep -i "Authorization: Basic [0-9a-zA-Z+/]" trace &&- grep -i "Authorization: Basic <redacted>" trace+ test_grep ! -i "Authorization: Basic [0-9a-zA-Z+/]" trace &&+ test_grep -i "Authorization: Basic <redacted>" trace ' test_expect_success 'GIT_CURL_VERBOSE redacts auth details' '@@ -276,8 +276,8 @@ test_expect_success 'GIT_CURL_VERBOSE redacts auth details' ' # Ensure that there is no "Basic" followed by a base64 string, but that # the auth details are redacted- ! grep -i "Authorization: Basic [0-9a-zA-Z+/]" trace &&- grep -i "Authorization: Basic <redacted>" trace+ test_grep ! -i "Authorization: Basic [0-9a-zA-Z+/]" trace &&+ test_grep -i "Authorization: Basic <redacted>" trace ' test_expect_success 'GIT_TRACE_CURL does not redact auth details if GIT_TRACE_REDACT=0' '@@ -287,7 +287,7 @@ test_expect_success 'GIT_TRACE_CURL does not redact auth details if GIT_TRACE_RE git clone --bare "$HTTPD_URL/auth/smart/repo.git" redact-auth && expect_askpass both user%40host &&- grep -i "Authorization: Basic [0-9a-zA-Z+/]" trace+ test_grep -i "Authorization: Basic [0-9a-zA-Z+/]" trace ' test_expect_success 'disable dumb http on server' '@@ -418,7 +418,7 @@ test_expect_success 'large fetch-pack requests can be sent using chunked encodin clone --bare "$HTTPD_URL/smart/repo.git" split.git 2>err && { test_have_prereq HTTP2 ||- grep "^=> Send header: Transfer-Encoding: chunked" err+ test_grep "^=> Send header: Transfer-Encoding: chunked" err } '@@ -553,10 +553,10 @@ test_expect_success 'cookies are redacted by default' ' GIT_TRACE_CURL=true \ git -c "http.cookieFile=$(pwd)/cookies" clone \ $HTTPD_URL/smart/repo.git clone 2>err &&- grep -i "Cookie:.*Foo=<redacted>" err &&- grep -i "Cookie:.*Bar=<redacted>" err &&- ! grep -i "Cookie:.*Foo=1" err &&- ! grep -i "Cookie:.*Bar=2" err+ test_grep -i "Cookie:.*Foo=<redacted>" err &&+ test_grep -i "Cookie:.*Bar=<redacted>" err &&+ test_grep ! -i "Cookie:.*Foo=1" err &&+ test_grep ! -i "Cookie:.*Bar=2" err ' test_expect_success 'empty values of cookies are also redacted' '@@ -565,7 +565,7 @@ test_expect_success 'empty values of cookies are also redacted' ' GIT_TRACE_CURL=true \ git -c "http.cookieFile=$(pwd)/cookies" clone \ $HTTPD_URL/smart/repo.git clone 2>err &&- grep -i "Cookie:.*Foo=<redacted>" err+ test_grep -i "Cookie:.*Foo=<redacted>" err ' test_expect_success 'GIT_TRACE_REDACT=0 disables cookie redaction' '@@ -575,20 +575,20 @@ test_expect_success 'GIT_TRACE_REDACT=0 disables cookie redaction' ' GIT_TRACE_REDACT=0 GIT_TRACE_CURL=true \ git -c "http.cookieFile=$(pwd)/cookies" clone \ $HTTPD_URL/smart/repo.git clone 2>err &&- grep -i "Cookie:.*Foo=1" err &&- grep -i "Cookie:.*Bar=2" err+ test_grep -i "Cookie:.*Foo=1" err &&+ test_grep -i "Cookie:.*Bar=2" err ' test_expect_success 'GIT_TRACE_CURL_NO_DATA prevents data from being traced' ' rm -rf clone && GIT_TRACE_CURL=true \ git clone $HTTPD_URL/smart/repo.git clone 2>err &&- grep "=> Send data" err &&+ test_grep "=> Send data" err && rm -rf clone && GIT_TRACE_CURL=true GIT_TRACE_CURL_NO_DATA=1 \ git clone $HTTPD_URL/smart/repo.git clone 2>err &&- ! grep "=> Send data" err+ test_grep ! "=> Send data" err ' test_expect_success 'server-side error detected' '@@ -643,7 +643,7 @@ test_expect_success 'client falls back from v2 to v0 to match server' ' git clone $HTTPD_URL/smart_v0/repo.git repo-v0 && # check for v0; there the HEAD symref is communicated in the capability # line; v2 uses a different syntax on each ref advertisement line- grep symref=HEAD:refs/heads/ trace+ test_grep symref=HEAD:refs/heads/ trace ' test_expect_success 'create empty http-accessible SHA-256 repository' '@@ -691,7 +691,7 @@ test_expect_success 'clone warns or fails when using username:password' ' git -c transfer.credentialsInUrl=allow \ clone $url_userpass attempt1 2>err &&- ! grep "$message" err &&+ test_grep ! "$message" err && git -c transfer.credentialsInUrl=warn \ clone $url_userpass attempt2 2>err &&@@ -720,12 +720,12 @@ test_expect_success 'clone does not detect username:password when it is https:// esac && git -c transfer.credentialsInUrl=warn clone $url_user attempt1 2>err &&- ! grep "uses plaintext credentials" err+ test_grep ! "uses plaintext credentials" err ' test_expect_success 'fetch warns or fails when using username:password' ' git -c transfer.credentialsInUrl=allow fetch $url_userpass 2>err &&- ! grep "$message" err &&+ test_grep ! "$message" err && git -c transfer.credentialsInUrl=warn fetch $url_userpass 2>err && grep "warning: $message" err >warnings &&@@ -745,7 +745,7 @@ test_expect_success 'fetch warns or fails when using username:password' ' test_expect_success 'push warns or fails when using username:password' ' git -c transfer.credentialsInUrl=allow push $url_userpass 2>err &&- ! grep "$message" err &&+ test_grep ! "$message" err && git -c transfer.credentialsInUrl=warn push $url_userpass 2>err && grep "warning: $message" err >warnings &&@@ -762,7 +762,7 @@ test_expect_success 'no empty path components' ' git clone $HTTPD_URL/smart/repo.git/ clone-with-slash && strip_access_log >log &&- ! grep "//" log+ test_grep ! "//" log ' test_expect_success 'tag following always works over v0 http' '
t/t5552-skipping-fetch-negotiator.sh
+3-3
index eeddb85b1d..96e224168e 100755--- a/t/t5552-skipping-fetch-negotiator.sh+++ b/t/t5552-skipping-fetch-negotiator.sh@@ -201,7 +201,7 @@ test_expect_success 'do not send "have" with ancestors of commits that server AC export GIT_TEST_PROTOCOL_VERSION && trace_fetch client "$(pwd)/server" to_fetch ) &&- grep " fetch" trace &&+ test_grep " fetch" trace && # fetch-pack sends 2 requests each containing 16 "have" lines before # processing the first response. In these 2 requests, 4 commits from@@ -211,8 +211,8 @@ test_expect_success 'do not send "have" with ancestors of commits that server AC # While fetch-pack is processing the first response, it should read that # the server ACKs b1.c19 and b1.c17.- grep "fetch< ACK $(git -C client rev-parse b1.c19) common" trace &&- grep "fetch< ACK $(git -C client rev-parse b1.c17) common" trace &&+ test_grep "fetch< ACK $(git -C client rev-parse b1.c19) common" trace &&+ test_grep "fetch< ACK $(git -C client rev-parse b1.c17) common" trace && # fetch-pack should thus not send any more commits in the b1 branch, but # should still send the others (in this test, just check b2).
index e7e1b6dab6..1ccfaee75a 100755--- a/t/t5583-push-branches.sh+++ b/t/t5583-push-branches.sh@@ -60,21 +60,21 @@ test_expect_success '--all or --branches can not be combined with refspecs' ' test_must_fail git push remote-1 --all main >actual.all 2>&1 && test_must_fail git push remote-1 --branches main >actual.branches 2>&1 && test_cmp actual.all actual.branches &&- grep "be combined with refspecs" actual.all+ test_grep "be combined with refspecs" actual.all ' test_expect_success '--all or --branches can not be combined with --mirror' ' test_must_fail git push remote-1 --all --mirror >actual.all 2>&1 && test_must_fail git push remote-1 --branches --mirror >actual.branches 2>&1 && test_cmp actual.all actual.branches &&- grep "cannot be used together" actual.all+ test_grep "cannot be used together" actual.all ' test_expect_success '--all or --branches can not be combined with --tags' ' test_must_fail git push remote-1 --all --tags >actual.all 2>&1 && test_must_fail git push remote-1 --branches --tags >actual.branches 2>&1 && test_cmp actual.all actual.branches &&- grep "cannot be used together" actual.all+ test_grep "cannot be used together" actual.all '@@ -82,7 +82,7 @@ test_expect_success '--all or --branches can not be combined with --delete' ' test_must_fail git push remote-1 --all --delete >actual.all 2>&1 && test_must_fail git push remote-1 --branches --delete >actual.branches 2>&1 && test_cmp actual.all actual.branches &&- grep "cannot be used together" actual.all+ test_grep "cannot be used together" actual.all ' test_expect_success '--all or --branches combines with --follow-tags have same behavior' '
t/t5601-clone.sh
+14-14
index 3dd229c186..b6167582a1 100755--- a/t/t5601-clone.sh+++ b/t/t5601-clone.sh@@ -159,8 +159,8 @@ test_expect_success 'clone --mirror does not repeat tags' ' git clone --mirror src mirror2 && (cd mirror2 && git show-ref 2> clone.err > clone.out) &&- ! grep Duplicate mirror2/clone.err &&- grep some-tag mirror2/clone.out+ test_grep ! Duplicate mirror2/clone.err &&+ test_grep some-tag mirror2/clone.out '@@ -224,12 +224,12 @@ test_expect_success 'clone a void' ' cd src-0 && git init ) && git clone "file://$(pwd)/src-0" target-6 2>err-6 &&- ! grep "fatal:" err-6 &&+ test_grep ! "fatal:" err-6 && ( cd src-0 && test_commit A ) && git clone "file://$(pwd)/src-0" target-7 2>err-7 &&- ! grep "fatal:" err-7 &&+ test_grep ! "fatal:" err-7 && # There is no reason to insist they are bit-for-bit # identical, but this test should suffice for now. test_cmp target-6/.git/config target-7/.git/config@@ -298,22 +298,22 @@ test_expect_success 'clone separate gitdir where target already exists' ' rm -rf dst && echo foo=bar >>realgitdir/config && test_must_fail git clone --separate-git-dir realgitdir src dst &&- grep foo=bar realgitdir/config+ test_grep foo=bar realgitdir/config ' test_expect_success 'clone --reference from original' ' git clone --shared --bare src src-1 && git clone --bare src src-2 && git clone --reference=src-2 --bare src-1 target-8 &&- grep /src-2/ target-8/objects/info/alternates+ test_grep /src-2/ target-8/objects/info/alternates ' test_expect_success 'clone with more than one --reference' ' git clone --bare src src-3 && git clone --bare src src-4 && git clone --reference=src-3 --reference=src-4 src target-9 &&- grep /src-3/ target-9/.git/objects/info/alternates &&- grep /src-4/ target-9/.git/objects/info/alternates+ test_grep /src-3/ target-9/.git/objects/info/alternates &&+ test_grep /src-4/ target-9/.git/objects/info/alternates ' test_expect_success 'clone from original with relative alternate' '@@ -321,7 +321,7 @@ test_expect_success 'clone from original with relative alternate' ' git clone --bare src nest/src-5 && echo ../../../src/.git/objects >nest/src-5/objects/info/alternates && git clone --bare nest/src-5 target-10 &&- grep /src/\\.git/objects target-10/objects/info/alternates+ test_grep /src/\\.git/objects target-10/objects/info/alternates ' test_expect_success 'clone checking out a tag' '@@ -663,8 +663,8 @@ test_expect_success PERL_TEST_HELPERS 'clone on case-insensitive fs' ' ' test_expect_success PERL_TEST_HELPERS,CASE_INSENSITIVE_FS 'colliding file detection' '- grep X icasefs/warning &&- grep x icasefs/warning &&+ test_grep X icasefs/warning &&+ test_grep x icasefs/warning && test_grep "the following paths have collided" icasefs/warning '@@ -857,7 +857,7 @@ test_expect_success 'auto-discover bundle URI from HTTP clone' ' cat >pattern <<-EOF && "event":"child_start".*"argv":\["git-remote-https","$HTTPD_URL/everything.bundle"\] EOF- grep -f pattern trace.txt+ test_grep -f pattern trace.txt ' test_expect_success 'auto-discover multiple bundles from HTTP clone' '@@ -888,11 +888,11 @@ test_expect_success 'auto-discover multiple bundles from HTTP clone' ' cat >pattern <<-EOF && "event":"child_start".*"argv":\["git-remote-https","$HTTPD_URL/everything.bundle"\] EOF- grep -f pattern trace.txt &&+ test_grep -f pattern trace.txt && cat >pattern <<-EOF && "event":"child_start".*"argv":\["git-remote-https","$HTTPD_URL/new.bundle"\] EOF- grep -f pattern trace.txt+ test_grep -f pattern trace.txt ' test_expect_success 'auto-discover multiple bundles from HTTP clone: creationToken heuristic' '
t/t5604-clone-reference.sh
+4-4
index c232ab8c15..39a0c318df 100755--- a/t/t5604-clone-reference.sh+++ b/t/t5604-clone-reference.sh@@ -65,7 +65,7 @@ test_expect_success 'cloning with reference (no -l -s)' ' test_expect_success 'fetched no objects' ' test -s "$U.D" &&- ! grep " want" "$U.D"+ test_grep ! " want" "$U.D" ' test_expect_success 'existence of info/alternates' '@@ -157,9 +157,9 @@ test_expect_success 'fetch with incomplete alternates' ' ) && main_object=$(git -C A rev-parse --verify refs/heads/main) && test -s "$U.K" &&- ! grep " want $main_object" "$U.K" &&+ test_grep ! " want $main_object" "$U.K" && tag_object=$(git -C A rev-parse --verify refs/tags/foo) &&- ! grep " want $tag_object" "$U.K"+ test_grep ! " want $tag_object" "$U.K" ' test_expect_success 'clone using repo with gitfile as a reference' '@@ -357,7 +357,7 @@ test_expect_success SYMLINKS 'clone repo with symlinked objects directory' ' test_must_fail git clone --local malicious clone 2>err && test_path_is_missing clone &&- grep "is a symlink, refusing to clone with --local" err+ test_grep "is a symlink, refusing to clone with --local" err ' test_expect_success 'dissociate from repo with commit graph' '
t/t5605-clone-local.sh
+1-1
index 2397f8fa61..156362f145 100755--- a/t/t5605-clone-local.sh+++ b/t/t5605-clone-local.sh@@ -172,7 +172,7 @@ test_expect_success REFFILES 'local clone from repo with corrupt refs fails grac echo a >corrupt/.git/refs/heads/topic && test_must_fail git clone corrupt working 2>err &&- grep "has neither a valid OID nor a target" err+ test_grep "has neither a valid OID nor a target" err ' test_done
t/t5606-clone-options.sh
+3-3
index 8a15237736..1b48da496b 100755--- a/t/t5606-clone-options.sh+++ b/t/t5606-clone-options.sh@@ -63,7 +63,7 @@ test_expect_success 'disallows --bundle-uri with shallow options' ' for option in --depth=1 --shallow-since=01-01-2000 --shallow-exclude=HEAD do test_must_fail git clone --bundle-uri=bundle $option from to 2>err &&- grep "bundle-uri.* cannot be used together" err || return 1+ test_grep "bundle-uri.* cannot be used together" err || return 1 done '@@ -147,7 +147,7 @@ test_expect_success 'prefers --origin over -c config' ' test_expect_success 'redirected clone does not show progress' ' git clone "file://$(pwd)/parent" clone-redirected >out 2>err &&- ! grep % err &&+ test_grep ! % err && test_grep ! "Checking connectivity" err '@@ -156,7 +156,7 @@ test_expect_success 'redirected clone -v does show progress' ' git clone --progress "file://$(pwd)/parent" clone-redirected-progress \ >out 2>err &&- grep % err+ test_grep % err '
t/t5612-clone-refspec.sh
+1-1
index 3126cfd7e9..dd1fe0abb4 100755--- a/t/t5612-clone-refspec.sh+++ b/t/t5612-clone-refspec.sh@@ -97,7 +97,7 @@ test_expect_success 'by default no tags will be kept updated' ' test_expect_success 'clone with --no-tags' ' ( cd dir_all_no_tags &&- grep tagOpt .git/config &&+ test_grep tagOpt .git/config && git fetch && git for-each-ref refs/tags >../actual ) &&
t/t5616-partial-clone.sh
+30-30
index 1c2805acca..ddbf2b72c6 100755--- a/t/t5616-partial-clone.sh+++ b/t/t5616-partial-clone.sh@@ -60,8 +60,8 @@ test_expect_success 'verify that .promisor file contains refs fetched' ' ls pc1/.git/objects/pack/pack-*.promisor >promisorlist && test_line_count = 1 promisorlist && git -C srv.bare rev-parse --verify HEAD >headhash &&- grep "$(cat headhash) HEAD" $(cat promisorlist) &&- grep "$(cat headhash) refs/heads/main" $(cat promisorlist)+ test_grep "$(cat headhash) HEAD" $(cat promisorlist) &&+ test_grep "$(cat headhash) refs/heads/main" $(cat promisorlist) ' # checkout main to force dynamic object fetch of blobs at HEAD.@@ -230,8 +230,8 @@ test_expect_success 'fetch --refetch triggers repacking' ' GIT_TRACE2_EVENT="$PWD/trace1.event" \ git -C pc1 fetch --refetch origin && test_subcommand git maintenance run --auto --no-quiet --no-detach <trace1.event &&- grep \"param\":\"gc.autopacklimit\",\"value\":\"1\" trace1.event &&- grep \"param\":\"maintenance.incremental-repack.auto\",\"value\":\"-1\" trace1.event &&+ test_grep \"param\":\"gc.autopacklimit\",\"value\":\"1\" trace1.event &&+ test_grep \"param\":\"maintenance.incremental-repack.auto\",\"value\":\"-1\" trace1.event && GIT_TRACE2_EVENT="$PWD/trace2.event" \ git -c protocol.version=0 \@@ -239,8 +239,8 @@ test_expect_success 'fetch --refetch triggers repacking' ' -c maintenance.incremental-repack.auto=1234 \ -C pc1 fetch --refetch origin && test_subcommand git maintenance run --auto --no-quiet --no-detach <trace2.event &&- grep \"param\":\"gc.autopacklimit\",\"value\":\"0\" trace2.event &&- grep \"param\":\"maintenance.incremental-repack.auto\",\"value\":\"-1\" trace2.event &&+ test_grep \"param\":\"gc.autopacklimit\",\"value\":\"0\" trace2.event &&+ test_grep \"param\":\"maintenance.incremental-repack.auto\",\"value\":\"-1\" trace2.event && GIT_TRACE2_EVENT="$PWD/trace3.event" \ git -c protocol.version=0 \@@ -248,8 +248,8 @@ test_expect_success 'fetch --refetch triggers repacking' ' -c maintenance.incremental-repack.auto=0 \ -C pc1 fetch --refetch origin && test_subcommand git maintenance run --auto --no-quiet --no-detach <trace3.event &&- grep \"param\":\"gc.autopacklimit\",\"value\":\"1\" trace3.event &&- grep \"param\":\"maintenance.incremental-repack.auto\",\"value\":\"0\" trace3.event+ test_grep \"param\":\"gc.autopacklimit\",\"value\":\"1\" trace3.event &&+ test_grep \"param\":\"maintenance.incremental-repack.auto\",\"value\":\"0\" trace3.event ' test_expect_success 'partial clone with transfer.fsckobjects=1 works with submodules' '@@ -284,7 +284,7 @@ test_expect_success 'partial clone with transfer.fsckobjects=1 uses index-pack - GIT_TRACE="$(pwd)/trace" git -c transfer.fsckobjects=1 \ clone --filter="blob:none" "file://$(pwd)/src" dst &&- grep "git index-pack.*--fsck-objects" trace+ test_grep "git index-pack.*--fsck-objects" trace ' test_expect_success 'use fsck before and after manually fetching a missing subtree' '@@ -312,7 +312,7 @@ test_expect_success 'use fsck before and after manually fetching a missing subtr # Auto-fetch a tree with cat-file. git -C dst cat-file -p $SUBTREE >tree_contents &&- grep file.txt tree_contents &&+ test_grep file.txt tree_contents && # fsck still works after an auto-fetch of a tree. git -C dst fsck &&@@ -333,14 +333,14 @@ test_expect_success 'implicitly construct combine: filter with repeated flags' ' GIT_TRACE=$(pwd)/trace git clone --bare \ --filter=blob:none --filter=tree:1 \ "file://$(pwd)/srv.bare" pc2 &&- grep "trace:.* git pack-objects .*--filter=combine:blob:none+tree:1" \+ test_grep "trace:.* git pack-objects .*--filter=combine:blob:none+tree:1" \ trace && git -C pc2 rev-list --objects --missing=allow-any HEAD >objects && # We should have gotten some root trees.- grep " $" objects &&+ test_grep " $" objects && # Should not have gotten any non-root trees or blobs.- ! grep " ." objects &&+ test_grep ! " ." objects && xargs -n 1 git -C pc2 cat-file -t <objects >types && sort -u types >unique_types.actual &&@@ -409,7 +409,7 @@ test_expect_success 'partial clone fetches blobs pointed to by refs even if norm git -C src tag myblob "$BLOB" && git clone --filter="blob:none" "file://$(pwd)/src" dst 2>err &&- ! grep "does not point to a valid object" err &&+ test_grep ! "does not point to a valid object" err && git -C dst fsck '@@ -424,10 +424,10 @@ test_expect_success 'fetch what is specified on CLI even if already promised' ' git clone --bare --filter=blob:none "file://$(pwd)/src" dst.git && git -C dst.git rev-list --objects --quiet --missing=print HEAD >missing_before &&- grep "?$(cat blob)" missing_before &&+ test_grep "?$(cat blob)" missing_before && git -C dst.git fetch origin $(cat blob) && git -C dst.git rev-list --objects --quiet --missing=print HEAD >missing_after &&- ! grep "?$(cat blob)" missing_after+ test_grep ! "?$(cat blob)" missing_after ' test_expect_success 'setup src repo for sparse filter' '@@ -449,8 +449,8 @@ test_expect_success 'partial clone with sparse filter succeeds' ' ( cd dst.git && git rev-list --objects --missing=print HEAD >out &&- grep "^$(git rev-parse HEAD:one.t)" out &&- grep "^?$(git rev-parse HEAD:two.t)" out+ test_grep "^$(git rev-parse HEAD:one.t)" out &&+ test_grep "^?$(git rev-parse HEAD:two.t)" out ) '@@ -521,7 +521,7 @@ test_expect_success 'fetch lazy-fetches only to resolve deltas' ' # Verify the assumption that the client needed to fetch the delta base # to resolve the delta. git -C server rev-parse HEAD~1^{tree} >hash &&- grep "want $(cat hash)" trace+ test_grep "want $(cat hash)" trace ' test_expect_success 'fetch lazy-fetches only to resolve deltas, protocol v2' '@@ -538,12 +538,12 @@ test_expect_success 'fetch lazy-fetches only to resolve deltas, protocol v2' ' fetch "file://$(pwd)/server" main && # Verify that protocol version 2 was used.- grep "fetch< version 2" trace &&+ test_grep "fetch< version 2" trace && # Verify the assumption that the client needed to fetch the delta base # to resolve the delta. git -C server rev-parse HEAD~1^{tree} >hash &&- grep "want $(cat hash)" trace+ test_grep "want $(cat hash)" trace ' test_expect_success 'fetch does not lazy-fetch missing targets of its refs' '@@ -563,7 +563,7 @@ test_expect_success 'fetch does not lazy-fetch missing targets of its refs' ' --no-tags --recurse-submodules=no \ origin refs/tags/bar && FOO_HASH=$(git -C server rev-parse foo) &&- ! grep "want $FOO_HASH" trace+ test_grep ! "want $FOO_HASH" trace ' # The following two tests must be in this order. It is important that@@ -621,7 +621,7 @@ test_expect_success 'fetch from a partial clone, protocol v0' ' test_config -C client protocol.version 0 && test_commit -C client bar && GIT_TRACE_PACKET="$(pwd)/trace" git -C client fetch "file://$(pwd)/server" &&- ! grep "version 2" trace+ test_grep ! "version 2" trace ' test_expect_success 'fetch from a partial clone, protocol v2' '@@ -640,7 +640,7 @@ test_expect_success 'fetch from a partial clone, protocol v2' ' test_config -C client protocol.version 2 && test_commit -C client bar && GIT_TRACE_PACKET="$(pwd)/trace" git -C client fetch "file://$(pwd)/server" &&- grep "version 2" trace+ test_grep "version 2" trace ' test_expect_success 'repack does not loosen promisor objects' '@@ -648,7 +648,7 @@ test_expect_success 'repack does not loosen promisor objects' ' git clone --bare --filter=blob:none "file://$(pwd)/srv.bare" client && test_when_finished "rm -rf client trace" && GIT_TRACE2_PERF="$(pwd)/trace" git -C client repack -A -d &&- grep "loosen_unused_packed_objects/loosened:0" trace+ test_grep "loosen_unused_packed_objects/loosened:0" trace ' test_expect_success 'lazy-fetch in submodule succeeds' '@@ -824,7 +824,7 @@ test_expect_success 'when partial cloning, tolerate server not sending target of # Exercise to make sure it works. git -c protocol.version=2 clone \ --filter=blob:none $HTTPD_URL/one_time_script/server repo 2> err &&- ! grep "missing object referenced by" err &&+ test_grep ! "missing object referenced by" err && # Ensure that the one-time-script script was used. ! test -e "$HTTPD_ROOT_PATH/one-time-script"@@ -881,13 +881,13 @@ test_expect_success PERL_TEST_HELPERS 'tolerate server sending REF_DELTA against # by any 3 nybbles, then the OID of the delta base. printf "f.,..%s" $(intersperse "," <deltabase_missing) >want && hex_unpack <thin.pack | intersperse "," >have &&- grep $(cat want) have &&+ test_grep $(cat want) have && # Ensure that the pack contains one delta against HEAD^:have.txt, # similar to the above. printf "f.,..%s" $(intersperse "," <deltabase_have) >want && hex_unpack <thin.pack | intersperse "," >have &&- grep $(cat want) have &&+ test_grep $(cat want) have && replace_packfile thin.pack &&@@ -901,8 +901,8 @@ test_expect_success PERL_TEST_HELPERS 'tolerate server sending REF_DELTA against # Ensure that the missing delta base was directly fetched, but not the # one that the client has.- grep "want $(cat deltabase_missing)" trace &&- ! grep "want $(cat deltabase_have)" trace &&+ test_grep "want $(cat deltabase_missing)" trace &&+ test_grep ! "want $(cat deltabase_have)" trace && # Ensure that the one-time-script script was used. ! test -e "$HTTPD_ROOT_PATH/one-time-script"
t/t5619-clone-local-ambiguous-transport.sh
+1-1
index cce62bf78d..e4218e5c7f 100755--- a/t/t5619-clone-local-ambiguous-transport.sh+++ b/t/t5619-clone-local-ambiguous-transport.sh@@ -64,7 +64,7 @@ test_expect_success 'ambiguous transport does not lead to arbitrary file-inclusi # # This works for now, and if we ever fix the URL detection, it # is OK to change this to detect the transport error.- grep "protocol .* is not supported" err+ test_grep "protocol .* is not supported" err ' test_done
t/t5620-backfill.sh
+6-6
index d2ea68e065..7462280470 100755--- a/t/t5620-backfill.sh+++ b/t/t5620-backfill.sh@@ -144,7 +144,7 @@ test_expect_success 'do partial clone 2, backfill min batch size' ' test_expect_success 'backfill --sparse without sparse-checkout fails' ' git init not-sparse && test_must_fail git -C not-sparse backfill --sparse 2>err &&- grep "problem loading sparse-checkout" err+ test_grep "problem loading sparse-checkout" err ' test_expect_success 'backfill --sparse' '@@ -422,7 +422,7 @@ test_expect_success 'backfill range with include-edges enables fetch-free git-lo -C backfill-log log -p HEAD~2..HEAD >log-output && # No promisor fetches should have been needed.- ! grep "fetch_count" log-trace+ test_grep ! "fetch_count" log-trace ' test_expect_success 'backfill range without include edges causes on-demand fetches in git-log' '@@ -439,7 +439,7 @@ test_expect_success 'backfill range without include edges causes on-demand fetch GIT_TRACE2_EVENT="$(pwd)/log-no-bdy-trace" git \ -C backfill-log-no-bdy log -p HEAD~2..HEAD >log-output &&- grep "fetch_count" log-no-bdy-trace+ test_grep "fetch_count" log-no-bdy-trace ' test_expect_success 'backfill range enables fetch-free replay' '@@ -470,7 +470,7 @@ test_expect_success 'backfill range enables fetch-free replay' ' GIT_TRACE2_EVENT="$(pwd)/replay-trace" git -C replay-dest.git \ replay --onto main topic~1..topic >replay-out &&- ! grep "fetch_count" replay-trace+ test_grep ! "fetch_count" replay-trace ' test_expect_success 'backfill enables fetch-free merge' '@@ -501,7 +501,7 @@ test_expect_success 'backfill enables fetch-free merge' ' GIT_TRACE2_EVENT="$(pwd)/merge-trace" git -C merge-dest \ merge origin/side -m "test merge" &&- ! grep "fetch_count" merge-trace+ test_grep ! "fetch_count" merge-trace ' . "$TEST_DIRECTORY"/lib-httpd.sh@@ -530,7 +530,7 @@ test_expect_success 'backfilling over HTTP succeeds' ' awk "{print \$1;}" <rev-list-out >oids && GIT_TRACE2_EVENT="$(pwd)/walk-trace" git -C backfill-http \ cat-file --batch-check <oids >batch-out &&- ! grep missing batch-out+ test_grep ! missing batch-out ' # DO NOT add non-httpd-specific tests here, because the last part of this
t/t5700-protocol-v1.sh
+23-23
index a73b4d4ff6..ffeb01afae 100755--- a/t/t5700-protocol-v1.sh+++ b/t/t5700-protocol-v1.sh@@ -33,9 +33,9 @@ test_expect_success 'clone with git:// using protocol v1' ' test_cmp expect actual && # Client requested to use protocol v1- grep "clone> .*\\\0\\\0version=1\\\0$" log &&+ test_grep "clone> .*\\\0\\\0version=1\\\0$" log && # Server responded using protocol v1- grep "clone< version 1" log+ test_grep "clone< version 1" log ' test_expect_success 'fetch with git:// using protocol v1' '@@ -49,9 +49,9 @@ test_expect_success 'fetch with git:// using protocol v1' ' test_cmp expect actual && # Client requested to use protocol v1- grep "fetch> .*\\\0\\\0version=1\\\0$" log &&+ test_grep "fetch> .*\\\0\\\0version=1\\\0$" log && # Server responded using protocol v1- grep "fetch< version 1" log+ test_grep "fetch< version 1" log ' test_expect_success 'pull with git:// using protocol v1' '@@ -63,9 +63,9 @@ test_expect_success 'pull with git:// using protocol v1' ' test_cmp expect actual && # Client requested to use protocol v1- grep "fetch> .*\\\0\\\0version=1\\\0$" log &&+ test_grep "fetch> .*\\\0\\\0version=1\\\0$" log && # Server responded using protocol v1- grep "fetch< version 1" log+ test_grep "fetch< version 1" log ' test_expect_success 'push with git:// using protocol v1' '@@ -81,9 +81,9 @@ test_expect_success 'push with git:// using protocol v1' ' test_cmp expect actual && # Client requested to use protocol v1- grep "push> .*\\\0\\\0version=1\\\0$" log &&+ test_grep "push> .*\\\0\\\0version=1\\\0$" log && # Server responded using protocol v1- grep "push< version 1" log+ test_grep "push< version 1" log ' stop_git_daemon@@ -104,7 +104,7 @@ test_expect_success 'clone with file:// using protocol v1' ' test_cmp expect actual && # Server responded using protocol v1- grep "clone< version 1" log+ test_grep "clone< version 1" log ' test_expect_success 'fetch with file:// using protocol v1' '@@ -118,7 +118,7 @@ test_expect_success 'fetch with file:// using protocol v1' ' test_cmp expect actual && # Server responded using protocol v1- grep "fetch< version 1" log+ test_grep "fetch< version 1" log ' test_expect_success 'pull with file:// using protocol v1' '@@ -130,7 +130,7 @@ test_expect_success 'pull with file:// using protocol v1' ' test_cmp expect actual && # Server responded using protocol v1- grep "fetch< version 1" log+ test_grep "fetch< version 1" log ' test_expect_success 'push with file:// using protocol v1' '@@ -146,7 +146,7 @@ test_expect_success 'push with file:// using protocol v1' ' test_cmp expect actual && # Server responded using protocol v1- grep "push< version 1" log+ test_grep "push< version 1" log ' test_expect_success 'cloning branchless tagless but not refless remote' '@@ -196,7 +196,7 @@ test_expect_success 'clone with ssh:// using protocol v1' ' test_cmp expect actual && # Server responded using protocol v1- grep "clone< version 1" log+ test_grep "clone< version 1" log ' test_expect_success 'fetch with ssh:// using protocol v1' '@@ -211,7 +211,7 @@ test_expect_success 'fetch with ssh:// using protocol v1' ' test_cmp expect actual && # Server responded using protocol v1- grep "fetch< version 1" log+ test_grep "fetch< version 1" log ' test_expect_success 'pull with ssh:// using protocol v1' '@@ -224,7 +224,7 @@ test_expect_success 'pull with ssh:// using protocol v1' ' test_cmp expect actual && # Server responded using protocol v1- grep "fetch< version 1" log+ test_grep "fetch< version 1" log ' test_expect_success 'push with ssh:// using protocol v1' '@@ -241,7 +241,7 @@ test_expect_success 'push with ssh:// using protocol v1' ' test_cmp expect actual && # Server responded using protocol v1- grep "push< version 1" log+ test_grep "push< version 1" log ' test_expect_success 'clone propagates object-format from empty repo' '@@ -277,9 +277,9 @@ test_expect_success 'clone with http:// using protocol v1' ' test_cmp expect actual && # Client requested to use protocol v1- grep "Git-Protocol: version=1" log &&+ test_grep "Git-Protocol: version=1" log && # Server responded using protocol v1- grep "git< version 1" log+ test_grep "git< version 1" log ' test_expect_success 'clone with http:// using protocol v1 with empty SHA-256 repo' '@@ -291,9 +291,9 @@ test_expect_success 'clone with http:// using protocol v1 with empty SHA-256 rep test_cmp expect actual && # Client requested to use protocol v1- grep "Git-Protocol: version=1" log &&+ test_grep "Git-Protocol: version=1" log && # Server responded using protocol v1- grep "git< version 1" log+ test_grep "git< version 1" log ' test_expect_success 'fetch with http:// using protocol v1' '@@ -307,7 +307,7 @@ test_expect_success 'fetch with http:// using protocol v1' ' test_cmp expect actual && # Server responded using protocol v1- grep "git< version 1" log+ test_grep "git< version 1" log ' test_expect_success 'pull with http:// using protocol v1' '@@ -319,7 +319,7 @@ test_expect_success 'pull with http:// using protocol v1' ' test_cmp expect actual && # Server responded using protocol v1- grep "git< version 1" log+ test_grep "git< version 1" log ' test_expect_success 'push with http:// using protocol v1' '@@ -335,7 +335,7 @@ test_expect_success 'push with http:// using protocol v1' ' test_cmp expect actual && # Server responded using protocol v1- grep "git< version 1" log+ test_grep "git< version 1" log ' # DO NOT add non-httpd-specific tests here, because the last part of this
index 081116220a..338df4f886 100755--- a/t/t6030-bisect-porcelain.sh+++ b/t/t6030-bisect-porcelain.sh@@ -118,8 +118,8 @@ test_expect_success 'bisect fails if given any junk instead of revs' ' test_expect_success 'bisect start without -- takes unknown arg as pathspec' ' git bisect reset && git bisect start foo bar &&- grep foo ".git/BISECT_NAMES" &&- grep bar ".git/BISECT_NAMES"+ test_grep foo ".git/BISECT_NAMES" &&+ test_grep bar ".git/BISECT_NAMES" ' test_expect_success 'bisect reset: back in a branch checked out also elsewhere' '@@ -258,7 +258,7 @@ test_expect_success 'bisect skip: successful result' ' git bisect start $HASH4 $HASH1 && git bisect skip && git bisect bad > my_bisect_log.txt &&- grep "$HASH2 is the first '\''bad'\'' commit" my_bisect_log.txt+ test_grep "$HASH2 is the first '\''bad'\'' commit" my_bisect_log.txt ' # $HASH1 is good, $HASH4 is bad, we skip $HASH3 and $HASH2@@ -269,11 +269,11 @@ test_expect_success 'bisect skip: cannot tell between 3 commits' ' git bisect start $HASH4 $HASH1 && git bisect skip && test_expect_code 2 git bisect skip >my_bisect_log.txt &&- grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&- ! grep $HASH1 my_bisect_log.txt &&- grep $HASH2 my_bisect_log.txt &&- grep $HASH3 my_bisect_log.txt &&- grep $HASH4 my_bisect_log.txt+ test_grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&+ test_grep ! $HASH1 my_bisect_log.txt &&+ test_grep $HASH2 my_bisect_log.txt &&+ test_grep $HASH3 my_bisect_log.txt &&+ test_grep $HASH4 my_bisect_log.txt ' # $HASH1 is good, $HASH4 is bad, we skip $HASH3@@ -285,11 +285,11 @@ test_expect_success 'bisect skip: cannot tell between 2 commits' ' git bisect start $HASH4 $HASH1 && git bisect skip && test_expect_code 2 git bisect good >my_bisect_log.txt &&- grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&- ! grep $HASH1 my_bisect_log.txt &&- ! grep $HASH2 my_bisect_log.txt &&- grep $HASH3 my_bisect_log.txt &&- grep $HASH4 my_bisect_log.txt+ test_grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&+ test_grep ! $HASH1 my_bisect_log.txt &&+ test_grep ! $HASH2 my_bisect_log.txt &&+ test_grep $HASH3 my_bisect_log.txt &&+ test_grep $HASH4 my_bisect_log.txt ' # $HASH1 is good, $HASH4 is both skipped and bad, we skip $HASH3@@ -304,11 +304,11 @@ test_expect_success 'bisect skip: with commit both bad and skipped' ' git bisect good $HASH1 && git bisect skip && test_expect_code 2 git bisect good >my_bisect_log.txt &&- grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&- ! grep $HASH1 my_bisect_log.txt &&- ! grep $HASH2 my_bisect_log.txt &&- grep $HASH3 my_bisect_log.txt &&- grep $HASH4 my_bisect_log.txt+ test_grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&+ test_grep ! $HASH1 my_bisect_log.txt &&+ test_grep ! $HASH2 my_bisect_log.txt &&+ test_grep $HASH3 my_bisect_log.txt &&+ test_grep $HASH4 my_bisect_log.txt ' test_bisect_run_args () {@@ -439,7 +439,7 @@ test_expect_success '"git bisect run" simple case' ' git bisect good $HASH1 && git bisect bad $HASH4 && git bisect run ./test_script.sh >my_bisect_log.txt &&- grep "$HASH3 is the first '\''bad'\'' commit" my_bisect_log.txt &&+ test_grep "$HASH3 is the first '\''bad'\'' commit" my_bisect_log.txt && git bisect reset '@@ -449,7 +449,7 @@ test_expect_success '"git bisect run" simple case' ' git bisect good $HASH1 && git bisect bad $HASH4 && git bisect run printf "%s %s\n" reset --bisect-skip >my_bisect_log.txt &&- grep -e "reset --bisect-skip" my_bisect_log.txt &&+ test_grep -e "reset --bisect-skip" my_bisect_log.txt && git bisect reset '@@ -461,7 +461,7 @@ test_expect_success '"git bisect run" with more complex "git bisect start"' ' EOF git bisect start $HASH4 $HASH1 && git bisect run ./test_script.sh >my_bisect_log.txt &&- grep "$HASH4 is the first '\''bad'\'' commit" my_bisect_log.txt &&+ test_grep "$HASH4 is the first '\''bad'\'' commit" my_bisect_log.txt && git bisect reset '@@ -474,7 +474,7 @@ test_expect_success 'bisect run accepts exit code 126 as bad' ' git bisect good $HASH1 && git bisect bad $HASH4 && git bisect run ./test_script.sh >my_bisect_log.txt &&- grep "$HASH3 is the first '\''bad'\'' commit" my_bisect_log.txt+ test_grep "$HASH3 is the first '\''bad'\'' commit" my_bisect_log.txt ' test_expect_success POSIXPERM 'bisect run fails with non-executable test script' '@@ -485,7 +485,7 @@ test_expect_success POSIXPERM 'bisect run fails with non-executable test script' git bisect good $HASH1 && git bisect bad $HASH4 && test_must_fail git bisect run ./not-executable.sh >my_bisect_log.txt &&- ! grep "is the first '\''bad'\'' commit" my_bisect_log.txt+ test_grep ! "is the first '\''bad'\'' commit" my_bisect_log.txt ' test_expect_success 'bisect run accepts exit code 127 as bad' '@@ -497,7 +497,7 @@ test_expect_success 'bisect run accepts exit code 127 as bad' ' git bisect good $HASH1 && git bisect bad $HASH4 && git bisect run ./test_script.sh >my_bisect_log.txt &&- grep "$HASH3 is the first '\''bad'\'' commit" my_bisect_log.txt+ test_grep "$HASH3 is the first '\''bad'\'' commit" my_bisect_log.txt ' test_expect_success 'bisect run fails with missing test script' '@@ -507,7 +507,7 @@ test_expect_success 'bisect run fails with missing test script' ' git bisect good $HASH1 && git bisect bad $HASH4 && test_must_fail git bisect run ./does-not-exist.sh >my_bisect_log.txt &&- ! grep "is the first '\''bad'\'' commit" my_bisect_log.txt+ test_grep ! "is the first '\''bad'\'' commit" my_bisect_log.txt ' # $HASH1 is good, $HASH5 is bad, we skip $HASH3@@ -520,14 +520,14 @@ test_expect_success 'bisect skip: add line and then a new test' ' git bisect start $HASH5 $HASH1 && git bisect skip && git bisect good > my_bisect_log.txt &&- grep "$HASH5 is the first '\''bad'\'' commit" my_bisect_log.txt &&+ test_grep "$HASH5 is the first '\''bad'\'' commit" my_bisect_log.txt && git bisect log > log_to_replay.txt && git bisect reset ' test_expect_success 'bisect skip and bisect replay' ' git bisect replay log_to_replay.txt > my_bisect_log.txt &&- grep "$HASH5 is the first '\''bad'\'' commit" my_bisect_log.txt &&+ test_grep "$HASH5 is the first '\''bad'\'' commit" my_bisect_log.txt && git bisect reset '@@ -541,11 +541,11 @@ test_expect_success 'bisect run & skip: cannot tell between 2' ' EOF git bisect start $HASH6 $HASH1 && test_expect_code 2 git bisect run ./test_script.sh >my_bisect_log.txt &&- grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&- ! grep $HASH3 my_bisect_log.txt &&- ! grep $HASH6 my_bisect_log.txt &&- grep $HASH4 my_bisect_log.txt &&- grep $HASH5 my_bisect_log.txt+ test_grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&+ test_grep ! $HASH3 my_bisect_log.txt &&+ test_grep ! $HASH6 my_bisect_log.txt &&+ test_grep $HASH4 my_bisect_log.txt &&+ test_grep $HASH5 my_bisect_log.txt ' HASH7=@@ -560,7 +560,7 @@ test_expect_success 'bisect run & skip: find first bad' ' EOF git bisect start $HASH7 $HASH1 && git bisect run ./test_script.sh >my_bisect_log.txt &&- grep "$HASH6 is the first '\''bad'\'' commit" my_bisect_log.txt+ test_grep "$HASH6 is the first '\''bad'\'' commit" my_bisect_log.txt ' test_expect_success 'bisect skip only one range' '@@ -569,7 +569,7 @@ test_expect_success 'bisect skip only one range' ' git bisect skip $HASH1..$HASH5 && test "$HASH6" = "$(git rev-parse --verify HEAD)" && test_must_fail git bisect bad > my_bisect_log.txt &&- grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt+ test_grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt ' test_expect_success 'bisect skip many ranges' '@@ -578,7 +578,7 @@ test_expect_success 'bisect skip many ranges' ' git bisect skip $HASH2 $HASH2.. ..$HASH5 && test "$HASH6" = "$(git rev-parse --verify HEAD)" && test_must_fail git bisect bad > my_bisect_log.txt &&- grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt+ test_grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt ' test_expect_success 'bisect starting with a detached HEAD' '@@ -610,7 +610,7 @@ test_expect_success 'bisect does not create a "bisect" branch' ' rev_hash6=$(git rev-parse --verify HEAD) && test "$rev_hash6" = "$HASH6" && git bisect good > my_bisect_log.txt &&- grep "$HASH7 is the first '\''bad'\'' commit" my_bisect_log.txt &&+ test_grep "$HASH7 is the first '\''bad'\'' commit" my_bisect_log.txt && git bisect reset && rev_hash6=$(git rev-parse --verify bisect) && test "$rev_hash6" = "$HASH6" &&@@ -637,26 +637,26 @@ test_expect_success 'side branch creation' ' test_expect_success 'good merge base when good and bad are siblings' ' git bisect start "$HASH7" "$SIDE_HASH7" > my_bisect_log.txt && test_grep "merge base must be tested" my_bisect_log.txt &&- grep $HASH4 my_bisect_log.txt &&+ test_grep $HASH4 my_bisect_log.txt && git bisect good > my_bisect_log.txt &&- ! grep "merge base must be tested" my_bisect_log.txt &&- grep $HASH6 my_bisect_log.txt &&+ test_grep ! "merge base must be tested" my_bisect_log.txt &&+ test_grep $HASH6 my_bisect_log.txt && git bisect reset ' test_expect_success 'skipped merge base when good and bad are siblings' ' git bisect start "$SIDE_HASH7" "$HASH7" > my_bisect_log.txt && test_grep "merge base must be tested" my_bisect_log.txt &&- grep $HASH4 my_bisect_log.txt &&+ test_grep $HASH4 my_bisect_log.txt && git bisect skip > my_bisect_log.txt 2>&1 &&- grep "warning" my_bisect_log.txt &&- grep $SIDE_HASH6 my_bisect_log.txt &&+ test_grep "warning" my_bisect_log.txt &&+ test_grep $SIDE_HASH6 my_bisect_log.txt && git bisect reset ' test_expect_success 'bad merge base when good and bad are siblings' ' git bisect start "$HASH7" HEAD > my_bisect_log.txt && test_grep "merge base must be tested" my_bisect_log.txt &&- grep $HASH4 my_bisect_log.txt &&+ test_grep $HASH4 my_bisect_log.txt && test_must_fail git bisect bad > my_bisect_log.txt 2>&1 && test_grep "merge base $HASH4 is bad" my_bisect_log.txt && test_grep "fixed between $HASH4 and \[$SIDE_HASH7\]" my_bisect_log.txt &&@@ -686,8 +686,8 @@ test_expect_success 'many merge bases creation' ' B_HASH=$(git rev-parse --verify HEAD) && git merge-base --all "$A_HASH" "$B_HASH" > merge_bases.txt && test_line_count = 2 merge_bases.txt &&- grep "$HASH5" merge_bases.txt &&- grep "$SIDE_HASH5" merge_bases.txt+ test_grep "$HASH5" merge_bases.txt &&+ test_grep "$SIDE_HASH5" merge_bases.txt ' # We want to automatically find the merge that@@ -703,7 +703,7 @@ test_expect_success '"git bisect run --first-parent" simple case' ' git bisect good $HASH4 && git bisect bad $B_HASH && git bisect run ./test_script.sh >my_bisect_log.txt &&- grep "$B_HASH is the first '\''bad'\'' commit" my_bisect_log.txt &&+ test_grep "$B_HASH is the first '\''bad'\'' commit" my_bisect_log.txt && git bisect reset && test_path_is_missing .git/BISECT_FIRST_PARENT '@@ -715,11 +715,11 @@ test_expect_success 'good merge bases when good and bad are siblings' ' test_grep "merge base must be tested" my_bisect_log2.txt && { {- grep "$SIDE_HASH5" my_bisect_log.txt &&- grep "$HASH5" my_bisect_log2.txt+ test_grep "$SIDE_HASH5" my_bisect_log.txt &&+ test_grep "$HASH5" my_bisect_log2.txt } || {- grep "$SIDE_HASH5" my_bisect_log2.txt &&- grep "$HASH5" my_bisect_log.txt+ test_grep "$SIDE_HASH5" my_bisect_log2.txt &&+ test_grep "$HASH5" my_bisect_log.txt } } && git bisect reset@@ -728,7 +728,7 @@ test_expect_success 'good merge bases when good and bad are siblings' ' test_expect_success 'optimized merge base checks' ' git bisect start "$HASH7" "$SIDE_HASH7" > my_bisect_log.txt && test_grep "merge base must be tested" my_bisect_log.txt &&- grep "$HASH4" my_bisect_log.txt &&+ test_grep "$HASH4" my_bisect_log.txt && git bisect good > my_bisect_log2.txt && test -f ".git/BISECT_ANCESTORS_OK" && test "$HASH6" = $(git rev-parse --verify HEAD) &&@@ -777,7 +777,7 @@ test_expect_success 'restricting bisection on one dir' ' para1=$(git rev-parse --verify HEAD) && test "$para1" = "$PARA_HASH1" && git bisect bad > my_bisect_log.txt &&- grep "$PARA_HASH1 is the first '\''bad'\'' commit" my_bisect_log.txt+ test_grep "$PARA_HASH1 is the first '\''bad'\'' commit" my_bisect_log.txt ' test_expect_success 'restricting bisection on one dir and a file' '@@ -795,7 +795,7 @@ test_expect_success 'restricting bisection on one dir and a file' ' para1=$(git rev-parse --verify HEAD) && test "$para1" = "$PARA_HASH1" && git bisect good > my_bisect_log.txt &&- grep "$PARA_HASH4 is the first '\''bad'\'' commit" my_bisect_log.txt+ test_grep "$PARA_HASH4 is the first '\''bad'\'' commit" my_bisect_log.txt ' test_expect_success 'skipping away from skipped commit' '@@ -826,7 +826,7 @@ test_expect_success 'test bisection on bare repo - --no-checkout specified' ' "test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \ >../nocheckout.log ) &&- grep "$HASH3 is the first '\''bad'\'' commit" nocheckout.log+ test_grep "$HASH3 is the first '\''bad'\'' commit" nocheckout.log '@@ -841,7 +841,7 @@ test_expect_success 'test bisection on bare repo - --no-checkout defaulted' ' "test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \ >../defaulted.log ) &&- grep "$HASH3 is the first '\''bad'\'' commit" defaulted.log+ test_grep "$HASH3 is the first '\''bad'\'' commit" defaulted.log ' #@@ -1031,21 +1031,21 @@ test_expect_success 'bisect start with one new and old' ' git bisect new $HASH4 && git bisect new && git bisect new >bisect_result &&- grep "$HASH2 is the first '\''new'\'' commit" bisect_result &&+ test_grep "$HASH2 is the first '\''new'\'' commit" bisect_result && git bisect log >log_to_replay.txt && git bisect reset ' test_expect_success 'bisect replay with old and new' ' git bisect replay log_to_replay.txt >bisect_result &&- grep "$HASH2 is the first '\''new'\'' commit" bisect_result &&+ test_grep "$HASH2 is the first '\''new'\'' commit" bisect_result && git bisect reset ' test_expect_success 'bisect replay with CRLF log' ' append_cr <log_to_replay.txt >log_to_replay_crlf.txt && git bisect replay log_to_replay_crlf.txt >bisect_result_crlf &&- grep "$HASH2 is the first '\''new'\'' commit" bisect_result_crlf &&+ test_grep "$HASH2 is the first '\''new'\'' commit" bisect_result_crlf && git bisect reset '@@ -1092,16 +1092,16 @@ test_expect_success 'bisect start with one term1 and term2' ' test_expect_success 'bogus command does not start bisect' ' git bisect reset && test_must_fail git bisect --bisect-terms 1 2 2>out &&- ! grep "You need to start" out &&+ test_grep ! "You need to start" out && test_must_fail git bisect --bisect-terms 2>out &&- ! grep "You need to start" out &&- grep "git bisect.*visualize" out &&+ test_grep ! "You need to start" out &&+ test_grep "git bisect.*visualize" out && git bisect reset ' test_expect_success 'bisect replay with term1 and term2' ' git bisect replay log_to_replay.txt >bisect_result &&- grep "$HASH2 is the first '\''term1'\'' commit" bisect_result &&+ test_grep "$HASH2 is the first '\''term1'\'' commit" bisect_result && git bisect reset '@@ -1120,7 +1120,7 @@ test_expect_success 'bisect start term1 term2' ' git bisect start --term-new term1 --term-old term2 $HASH4 $HASH1 && git bisect term1 && git bisect term1 >bisect_result &&- grep "$HASH2 is the first '\''term1'\'' commit" bisect_result &&+ test_grep "$HASH2 is the first '\''term1'\'' commit" bisect_result && git bisect log >log_to_replay.txt && git bisect reset '@@ -1212,7 +1212,7 @@ test_expect_success 'bisect handles annotated tags' ' git bisect good tag-one && git bisect bad tag-two >output && bad=$(git rev-parse --verify tag-two^{commit}) &&- grep "$bad is the first '\''bad'\'' commit" output+ test_grep "$bad is the first '\''bad'\'' commit" output ' test_expect_success 'bisect run fails with exit code equals or greater than 128' '@@ -1236,29 +1236,29 @@ test_expect_success 'bisect visualize with a filename with dash and space' ' test_expect_success 'bisect state output with multiple good commits' ' git bisect reset && git bisect start >output &&- grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output &&+ test_grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output && git bisect log >output &&- grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output &&+ test_grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output && git bisect good "$HASH1" >output &&- grep "waiting for '\''bad'\'' commit, 1 '\''good'\'' commit known" output &&+ test_grep "waiting for '\''bad'\'' commit, 1 '\''good'\'' commit known" output && git bisect log >output &&- grep "waiting for '\''bad'\'' commit, 1 '\''good'\'' commit known" output &&+ test_grep "waiting for '\''bad'\'' commit, 1 '\''good'\'' commit known" output && git bisect good "$HASH2" >output &&- grep "waiting for '\''bad'\'' commit, 2 '\''good'\'' commits known" output &&+ test_grep "waiting for '\''bad'\'' commit, 2 '\''good'\'' commits known" output && git bisect log >output &&- grep "waiting for '\''bad'\'' commit, 2 '\''good'\'' commits known" output+ test_grep "waiting for '\''bad'\'' commit, 2 '\''good'\'' commits known" output ' test_expect_success 'bisect state output with bad commit' ' git bisect reset && git bisect start >output &&- grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output &&+ test_grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output && git bisect log >output &&- grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output &&+ test_grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output && git bisect bad "$HASH4" >output &&- grep -F "waiting for '\''good'\'' commit(s), '\''bad'\'' commit known" output &&+ test_grep -F "waiting for '\''good'\'' commit(s), '\''bad'\'' commit known" output && git bisect log >output &&- grep -F "waiting for '\''good'\'' commit(s), '\''bad'\'' commit known" output+ test_grep -F "waiting for '\''good'\'' commit(s), '\''bad'\'' commit known" output ' test_expect_success 'verify correct error message' '@@ -1268,7 +1268,7 @@ test_expect_success 'verify correct error message' ' rm .git/BISECT* EOF test_must_fail git bisect run ./test_script.sh 2>error &&- grep "git bisect good.*exited with error code" error+ test_grep "git bisect good.*exited with error code" error ' test_done
t/t6040-tracking-info.sh
+1-1
index 0242b5bf7a..ddedce5442 100755--- a/t/t6040-tracking-info.sh+++ b/t/t6040-tracking-info.sh@@ -275,7 +275,7 @@ test_expect_success '--set-upstream-to does not change branch' ' git branch --set-upstream-to main from-topic_2 && git config branch.from-main.merge > actual && git rev-parse from-topic_2 >actual2 &&- grep -q "^refs/heads/main$" actual &&+ test_grep -q "^refs/heads/main$" actual && cmp expect2 actual2 '
t/t6112-rev-list-filters-objects.sh
+12-12
index e0a825bccf..a1c244c32d 100755--- a/t/t6112-rev-list-filters-objects.sh+++ b/t/t6112-rev-list-filters-objects.sh@@ -45,8 +45,8 @@ test_expect_success 'specify blob explicitly prevents filtering' ' awk -f print_2.awk) && git -C r1 rev-list --objects --filter=blob:none HEAD $file_3 >observed &&- grep "$file_3" observed &&- ! grep "$file_4" observed+ test_grep "$file_3" observed &&+ test_grep ! "$file_4" observed ' test_expect_success 'verify emitted+omitted == all' '@@ -324,7 +324,7 @@ test_expect_success 'rev-list W/ --missing=print and --missing=allow-any for tre git -C r3.b rev-list --missing=allow-any --objects HEAD \ >objs 2>rev_list_err &&- ! grep $TREE objs &&+ test_grep ! $TREE objs && test_must_be_empty rev_list_err '@@ -353,7 +353,7 @@ test_expect_success 'verify skipping tree iteration when not collecting omits' ' test_line_count = 2 actual && # Make sure no other trees were considered besides the root.- ! grep "Skipping contents of tree [^.]" filter_trace &&+ test_grep ! "Skipping contents of tree [^.]" filter_trace && # Try this again with "combine:". If both sub-filters are skipping # trees, the composite filter should also skip trees. This is not@@ -539,7 +539,7 @@ test_expect_success 'combine:... with more than two sub-filters' ' HEAD >actual && test_cmp expect actual &&- grep "Add to combine filter-spec: sparse:oid=main:p%3bat%25ter%2bn" \+ test_grep "Add to combine filter-spec: sparse:oid=main:p%3bat%25ter%2bn" \ trace1 && # Repeat the above test, but this time, the characters to encode are in@@ -551,7 +551,7 @@ test_expect_success 'combine:... with more than two sub-filters' ' HEAD >actual && test_cmp expect actual &&- grep "Add to combine filter-spec: sparse:oid=main:%5e%7epattern" \+ test_grep "Add to combine filter-spec: sparse:oid=main:%5e%7epattern" \ trace2 '@@ -623,9 +623,9 @@ test_expect_success 'verify collecting omits in combined: filter' ' omitted_2=$(echo a | git hash-object --stdin) && omitted_3=$(echo abcde | git hash-object --stdin) &&- grep "~$omitted_1" actual &&- grep "~$omitted_2" actual &&- grep "~$omitted_3" actual &&+ test_grep "~$omitted_1" actual &&+ test_grep "~$omitted_2" actual &&+ test_grep "~$omitted_3" actual && test_line_count = 3 actual '@@ -654,7 +654,7 @@ test_expect_success 'tree:<depth> which filters out blob but given as arg' ' blob_hash=$(git -C r4 rev-parse HEAD:subdir/bar) && git -C r4 rev-list --objects --filter=tree:1 HEAD $blob_hash >actual &&- grep ^$blob_hash actual+ test_grep ^$blob_hash actual ' # Delete some loose objects and use rev-list, but WITHOUT any filtering.@@ -693,8 +693,8 @@ test_expect_success 'expand blob limit in protocol' ' git -C r2 config --local uploadpack.allowfilter 1 && GIT_TRACE_PACKET="$(pwd)/trace" git -c protocol.version=2 clone \ --filter=blob:limit=1k "file://$(pwd)/r2" limit &&- ! grep "blob:limit=1k" trace &&- grep "blob:limit=1024" trace+ test_grep ! "blob:limit=1k" trace &&+ test_grep "blob:limit=1024" trace ' test_expect_success EXPENSIVE 'large sparse filter file ignored' '
t/t6115-rev-list-du.sh
+2-2
index 04c577dad6..b9650b80a4 100755--- a/t/t6115-rev-list-du.sh+++ b/t/t6115-rev-list-du.sh@@ -61,13 +61,13 @@ check_du --all --objects --unpacked test_expect_success 'rev-list --disk-usage=human' ' git rev-list --objects HEAD --disk-usage=human >actual && disk_usage_slow --objects HEAD >actual_size &&- grep "$(cat actual_size) bytes" actual+ test_grep "$(cat actual_size) bytes" actual ' test_expect_success 'rev-list --disk-usage=human with bitmaps' ' git rev-list --objects HEAD --use-bitmap-index --disk-usage=human >actual && disk_usage_slow --objects HEAD >actual_size &&- grep "$(cat actual_size) bytes" actual+ test_grep "$(cat actual_size) bytes" actual ' test_expect_success 'rev-list use --disk-usage unproperly' '
t/t6120-describe.sh
+7-7
index 8ee3d2c37d..12b4fb307b 100755--- a/t/t6120-describe.sh+++ b/t/t6120-describe.sh@@ -128,7 +128,7 @@ test_expect_success 'renaming tag A to Q locally produces a warning' " warning: tag 'Q' is externally known as 'A' EOF test_cmp expected err &&- grep -E '^A-8-g[0-9a-f]+$' out+ test_grep -E '^A-8-g[0-9a-f]+$' out " test_expect_success 'misnamed annotated tag forces long output' '@@ -160,7 +160,7 @@ check_describe A-8-gHASH HEAD test_expect_success 'describe works from outside repo using --git-dir' ' git clone --bare "$TRASH_DIRECTORY" "$TRASH_DIRECTORY/bare" && git --git-dir "$TRASH_DIRECTORY/bare" describe >out &&- grep -E "^A-8-g[0-9a-f]+$" out+ test_grep -E "^A-8-g[0-9a-f]+$" out ' check_describe "A-8-gHASH" --dirty@@ -170,7 +170,7 @@ test_expect_success 'describe --dirty with --work-tree' ' cd "$TEST_DIRECTORY" && git --git-dir "$TRASH_DIRECTORY/.git" --work-tree "$TRASH_DIRECTORY" describe --dirty >"$TRASH_DIRECTORY/out" ) &&- grep -E "^A-8-g[0-9a-f]+$" out+ test_grep -E "^A-8-g[0-9a-f]+$" out ' test_expect_success 'set-up dirty work tree' '@@ -183,7 +183,7 @@ test_expect_success 'describe --dirty with --work-tree (dirty)' ' cd "$TEST_DIRECTORY" && git --git-dir "$TRASH_DIRECTORY/.git" --work-tree "$TRASH_DIRECTORY" describe --dirty >"$TRASH_DIRECTORY/out" ) &&- grep -E "^A-8-g[0-9a-f]+-dirty$" out &&+ test_grep -E "^A-8-g[0-9a-f]+-dirty$" out && test_cmp expected out '@@ -193,7 +193,7 @@ test_expect_success 'describe --dirty=.mod with --work-tree (dirty)' ' cd "$TEST_DIRECTORY" && git --git-dir "$TRASH_DIRECTORY/.git" --work-tree "$TRASH_DIRECTORY" describe --dirty=.mod >"$TRASH_DIRECTORY/out" ) &&- grep -E "^A-8-g[0-9a-f]+.mod$" out &&+ test_grep -E "^A-8-g[0-9a-f]+.mod$" out && test_cmp expected out '@@ -377,7 +377,7 @@ test_expect_success 'describe chokes on severely broken submodules' ' test_expect_success 'describe ignoring a broken submodule' ' git describe --broken >out &&- grep broken out+ test_grep broken out ' test_expect_success 'describe with --work-tree ignoring a broken submodule' '@@ -386,7 +386,7 @@ test_expect_success 'describe with --work-tree ignoring a broken submodule' ' git --git-dir "$TRASH_DIRECTORY/.git" --work-tree "$TRASH_DIRECTORY" describe --broken >"$TRASH_DIRECTORY/out" ) && test_when_finished "mv .git/modules/sub_moved .git/modules/sub1" &&- grep broken out+ test_grep broken out ' test_expect_success 'describe a blob at a directly tagged commit' '
t/t6200-fmt-merge-msg.sh
+41-41
index 011e5df1e6..79fe1f20b4 100755--- a/t/t6200-fmt-merge-msg.sh+++ b/t/t6200-fmt-merge-msg.sh@@ -125,20 +125,20 @@ test_expect_success GPG 'message for merging local tag signed by good key' ' git checkout main && git fetch . signed-good-tag && git fmt-merge-msg <.git/FETCH_HEAD >actual &&- grep "^Merge tag ${apos}signed-good-tag${apos}" actual &&- grep "^signed-tag-msg" actual &&- grep "^# gpg: Signature made" actual &&- grep "^# gpg: Good signature from" actual+ test_grep "^Merge tag ${apos}signed-good-tag${apos}" actual &&+ test_grep "^signed-tag-msg" actual &&+ test_grep "^# gpg: Signature made" actual &&+ test_grep "^# gpg: Good signature from" actual ' test_expect_success GPG 'message for merging local tag signed by unknown key' ' git checkout main && git fetch . signed-good-tag && GNUPGHOME=. git fmt-merge-msg <.git/FETCH_HEAD >actual &&- grep "^Merge tag ${apos}signed-good-tag${apos}" actual &&- grep "^signed-tag-msg" actual &&- grep "^# gpg: Signature made" actual &&- grep -E "^# gpg: Can${apos}t check signature: (public key not found|No public key)" actual+ test_grep "^Merge tag ${apos}signed-good-tag${apos}" actual &&+ test_grep "^signed-tag-msg" actual &&+ test_grep "^# gpg: Signature made" actual &&+ test_grep -E "^# gpg: Can${apos}t check signature: (public key not found|No public key)" actual ' test_expect_success GPGSSH 'message for merging local tag signed by good ssh key' '@@ -146,10 +146,10 @@ test_expect_success GPGSSH 'message for merging local tag signed by good ssh key git checkout main && git fetch . signed-good-ssh-tag && git fmt-merge-msg <.git/FETCH_HEAD >actual &&- grep "^Merge tag ${apos}signed-good-ssh-tag${apos}" actual &&- grep "^signed-ssh-tag-msg" actual &&- grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&- ! grep "${GPGSSH_BAD_SIGNATURE}" actual+ test_grep "^Merge tag ${apos}signed-good-ssh-tag${apos}" actual &&+ test_grep "^signed-ssh-tag-msg" actual &&+ test_grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&+ test_grep ! "${GPGSSH_BAD_SIGNATURE}" actual ' test_expect_success GPGSSH 'message for merging local tag signed by unknown ssh key' '@@ -157,11 +157,11 @@ test_expect_success GPGSSH 'message for merging local tag signed by unknown ssh git checkout main && git fetch . signed-untrusted-ssh-tag && git fmt-merge-msg <.git/FETCH_HEAD >actual &&- grep "^Merge tag ${apos}signed-untrusted-ssh-tag${apos}" actual &&- grep "^signed-ssh-tag-msg-untrusted" actual &&- grep "${GPGSSH_GOOD_SIGNATURE_UNTRUSTED}" actual &&- ! grep "${GPGSSH_BAD_SIGNATURE}" actual &&- grep "${GPGSSH_KEY_NOT_TRUSTED}" actual+ test_grep "^Merge tag ${apos}signed-untrusted-ssh-tag${apos}" actual &&+ test_grep "^signed-ssh-tag-msg-untrusted" actual &&+ test_grep "${GPGSSH_GOOD_SIGNATURE_UNTRUSTED}" actual &&+ test_grep ! "${GPGSSH_BAD_SIGNATURE}" actual &&+ test_grep "${GPGSSH_KEY_NOT_TRUSTED}" actual ' test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'message for merging local tag signed by expired ssh key' '@@ -169,9 +169,9 @@ test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'message for merging local tag sign git checkout main && git fetch . expired-signed && git fmt-merge-msg <.git/FETCH_HEAD >actual &&- grep "^Merge tag ${apos}expired-signed${apos}" actual &&- grep "^expired-signed" actual &&- ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual+ test_grep "^Merge tag ${apos}expired-signed${apos}" actual &&+ test_grep "^expired-signed" actual &&+ test_grep ! "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual ' test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'message for merging local tag signed by not yet valid ssh key' '@@ -179,9 +179,9 @@ test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'message for merging local tag sign git checkout main && git fetch . notyetvalid-signed && git fmt-merge-msg <.git/FETCH_HEAD >actual &&- grep "^Merge tag ${apos}notyetvalid-signed${apos}" actual &&- grep "^notyetvalid-signed" actual &&- ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual+ test_grep "^Merge tag ${apos}notyetvalid-signed${apos}" actual &&+ test_grep "^notyetvalid-signed" actual &&+ test_grep ! "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual ' test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'message for merging local tag signed by valid timeboxed ssh key' '@@ -189,10 +189,10 @@ test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'message for merging local tag sign git checkout main && git fetch . timeboxedvalid-signed && git fmt-merge-msg <.git/FETCH_HEAD >actual &&- grep "^Merge tag ${apos}timeboxedvalid-signed${apos}" actual &&- grep "^timeboxedvalid-signed" actual &&- grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&- ! grep "${GPGSSH_BAD_SIGNATURE}" actual+ test_grep "^Merge tag ${apos}timeboxedvalid-signed${apos}" actual &&+ test_grep "^timeboxedvalid-signed" actual &&+ test_grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&+ test_grep ! "${GPGSSH_BAD_SIGNATURE}" actual ' test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'message for merging local tag signed by invalid timeboxed ssh key' '@@ -200,9 +200,9 @@ test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'message for merging local tag sign git checkout main && git fetch . timeboxedinvalid-signed && git fmt-merge-msg <.git/FETCH_HEAD >actual &&- grep "^Merge tag ${apos}timeboxedinvalid-signed${apos}" actual &&- grep "^timeboxedinvalid-signed" actual &&- ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual+ test_grep "^Merge tag ${apos}timeboxedinvalid-signed${apos}" actual &&+ test_grep "^timeboxedinvalid-signed" actual &&+ test_grep ! "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual ' test_expect_success 'message for merging external branch' '@@ -651,21 +651,21 @@ test_expect_success 'merge --into-name=<name>' ' git show -s --format="%s" >full.0 && head -n1 full.0 >actual && # expect that HEAD is shown as-is- grep -e "Merge branch .side. into HEAD$" actual &&+ test_grep -e "Merge branch .side. into HEAD$" actual && git reset --hard main && git merge --no-ff --into-name=main side && git show -s --format="%s" >full.1 && head -n1 full.1 >actual && # expect that we pretend to be merging to main, that is suppressed- grep -e "Merge branch .side.$" actual &&+ test_grep -e "Merge branch .side.$" actual && git checkout -b throwaway main && git merge --no-ff --into-name=main side && git show -s --format="%s" >full.2 && head -n1 full.2 >actual && # expect that we pretend to be merging to main, that is suppressed- grep -e "Merge branch .side.$" actual+ test_grep -e "Merge branch .side.$" actual ' test_expect_success 'merge.suppressDest configuration' '@@ -677,28 +677,28 @@ test_expect_success 'merge.suppressDest configuration' ' git -c merge.suppressDest="" fmt-merge-msg <.git/FETCH_HEAD >full.1 && head -n1 full.1 >actual &&- grep -e "Merge branch .side. into main" actual &&+ test_grep -e "Merge branch .side. into main" actual && git -c merge.suppressDest="mast" fmt-merge-msg <.git/FETCH_HEAD >full.2 && head -n1 full.2 >actual &&- grep -e "Merge branch .side. into main$" actual &&+ test_grep -e "Merge branch .side. into main$" actual && git -c merge.suppressDest="ma?*[rn]" fmt-merge-msg <.git/FETCH_HEAD >full.3 && head -n1 full.3 >actual &&- grep -e "Merge branch .side." actual &&- ! grep -e " into main$" actual &&+ test_grep -e "Merge branch .side." actual &&+ test_grep ! -e " into main$" actual && git checkout --detach HEAD && git -c merge.suppressDest="main" fmt-merge-msg <.git/FETCH_HEAD >full.4 && head -n1 full.4 >actual &&- grep -e "Merge branch .side. into HEAD$" actual &&+ test_grep -e "Merge branch .side. into HEAD$" actual && git -c merge.suppressDest="main" fmt-merge-msg \ --into-name=main <.git/FETCH_HEAD >full.5 && head -n1 full.5 >actual &&- grep -e "Merge branch .side." actual &&- ! grep -e " into main$" actual &&- ! grep -e " into HEAD$" actual+ test_grep -e "Merge branch .side." actual &&+ test_grep ! -e " into main$" actual &&+ test_grep ! -e " into HEAD$" actual ' test_done
t/t6402-merge-rename.sh
+2-2
index ff00b74e9c..fb1595ae53 100755--- a/t/t6402-merge-rename.sh+++ b/t/t6402-merge-rename.sh@@ -332,7 +332,7 @@ test_expect_success 'Same as previous, but merged other way' ' git checkout -q dir-in-way^0 && test_must_fail git merge --strategy=recursive renamed-file-has-no-conflicts >output 2>errors &&- ! grep "error: refusing to lose untracked file at" errors &&+ test_grep ! "error: refusing to lose untracked file at" errors && test_grep "CONFLICT (modify/delete): dir/file-in-the-way" output && test_grep "Auto-merging dir" output && test_grep "moving it to dir~renamed-file-has-no-conflicts instead" output &&@@ -883,7 +883,7 @@ test_expect_success 'setup spurious "refusing to lose untracked" message' ' test_expect_success 'no spurious "refusing to lose untracked" message' ' git checkout main^0 && test_must_fail git merge rename^0 2>errors.txt &&- ! grep "refusing to lose untracked file" errors.txt+ test_grep ! "refusing to lose untracked file" errors.txt ' test_expect_success 'do not follow renames for empty files' '
index e18d5a227d..d1f1de14e7 100755--- a/t/t6422-merge-rename-corner-cases.sh+++ b/t/t6422-merge-rename-corner-cases.sh@@ -916,8 +916,8 @@ test_expect_success 'rad-check: rename/add/delete conflict' ' # bar should have two-way merged contents of the different # versions of bar; check that content from both sides is # present.- grep original bar &&- grep different bar+ test_grep original bar &&+ test_grep different bar ) '@@ -991,8 +991,8 @@ test_expect_success 'rrdd-check: rename/rename(2to1)/delete/delete conflict' ' # baz should have two-way merged contents of the original # contents of foo and bar; check that content from both sides # is present.- grep foo baz &&- grep bar baz+ test_grep foo baz &&+ test_grep bar baz ) '
t/t6423-merge-rename-directories.sh
+36-36
index 53535a8ebf..24d4c5447b 100755--- a/t/t6423-merge-rename-directories.sh+++ b/t/t6423-merge-rename-directories.sh@@ -1113,7 +1113,7 @@ test_expect_success '5c: Transitive rename would cause rename/rename/rename/add/ test_cmp expect actual && test_path_is_missing x/d && test_path_is_file y/d &&- grep -q "<<<<" y/d # conflict markers should be present+ test_grep -q "<<<<" y/d # conflict markers should be present ) '@@ -2841,10 +2841,10 @@ test_expect_success '9e: N-to-1 whammo' ' test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out && grep "CONFLICT (implicit dir rename): Cannot map more than one path to combined/yo" out >error_line &&- grep -q dir1/yo error_line &&- grep -q dir2/yo error_line &&- grep -q dir3/yo error_line &&- grep -q dirN/yo error_line &&+ test_grep -q dir1/yo error_line &&+ test_grep -q dir2/yo error_line &&+ test_grep -q dir3/yo error_line &&+ test_grep -q dirN/yo error_line && git ls-files -s >out && test_line_count = 16 out &&@@ -3578,7 +3578,7 @@ test_expect_success '11b: Avoid losing dirty file involved in directory rename' test_path_is_missing .git/MERGE_HEAD && test_grep "error: Your local changes to the following files would be overwritten by merge" err &&- grep -q stuff z/c &&+ test_grep -q stuff z/c && test_seq 1 10 >expected && echo stuff >>expected && test_cmp expected z/c@@ -3636,7 +3636,7 @@ test_expect_success '11c: Avoid losing not-uptodate with rename + D/F conflict' test_path_is_missing .git/MERGE_HEAD && test_grep "error: Your local changes to the following files would be overwritten by merge" err &&- grep -q stuff y/c &&+ test_grep -q stuff y/c && test_seq 1 10 >expected && echo stuff >>expected && test_cmp expected y/c &&@@ -3705,7 +3705,7 @@ test_expect_success '11d: Avoid losing not-uptodate with rename + D/F conflict' test_path_is_missing .git/MERGE_HEAD && test_grep "error: Your local changes to the following files would be overwritten by merge" err &&- grep -q stuff z/c &&+ test_grep -q stuff z/c && test_seq 1 10 >expected && echo stuff >>expected && test_cmp expected z/c@@ -4779,7 +4779,7 @@ test_expect_success '12i: Directory rename causes rename-to-self' ' test_must_fail git -c merge.directoryRenames=conflict merge -s recursive B^0 >out &&- grep "CONFLICT (implicit dir rename).*source/bar in the way" out &&+ test_grep "CONFLICT (implicit dir rename).*source/bar in the way" out && test_path_is_missing source/bar && test_path_is_file source/subdir/bar && test_path_is_file source/baz &&@@ -4920,7 +4920,7 @@ test_expect_success '12j: Directory rename to root causes rename-to-self' ' # error about there being a file in the way. test_must_fail git -c merge.directoryRenames=conflict merge -s recursive B^0 >out &&- grep "CONFLICT (implicit dir rename).*bar in the way" out &&+ test_grep "CONFLICT (implicit dir rename).*bar in the way" out && test_path_is_missing bar && test_path_is_file subdir/bar &&@@ -4999,7 +4999,7 @@ test_expect_success '12k: Directory rename with sibling causes rename-to-self' ' # error about there being a file in the way. test_must_fail git -c merge.directoryRenames=conflict merge -s recursive B^0 >out &&- grep "CONFLICT (implicit dir rename).*dirA/bar in the way" out &&+ test_grep "CONFLICT (implicit dir rename).*dirA/bar in the way" out && test_path_is_missing dirA/bar && test_path_is_file dirB/bar &&@@ -5402,7 +5402,7 @@ test_expect_success '12o: Directory rename hits other rename source; file still test_stdout_line_count = 1 git ls-files -s B/stuff && test_stdout_line_count = 1 git ls-files -s D/file2 &&- grep "CONFLICT (implicit dir rename).*Existing file/dir at A/file1 in the way" out &&+ test_grep "CONFLICT (implicit dir rename).*Existing file/dir at A/file1 in the way" out && test_stdout_line_count = 1 git ls-files -s C/file1 ) '@@ -5489,7 +5489,7 @@ test_expect_success '12p: Directory rename hits other rename source; file still test_stdout_line_count = 1 git ls-files -s B/stuff && test_stdout_line_count = 1 git ls-files -s D/file2 &&- grep "CONFLICT (implicit dir rename).*Existing file/dir at A/file1 in the way" out &&+ test_grep "CONFLICT (implicit dir rename).*Existing file/dir at A/file1 in the way" out && test_stdout_line_count = 1 git ls-files -s C/file1 ) '@@ -5570,8 +5570,8 @@ test_expect_success '12q: Directory rename hits other rename source; file remove test_must_fail git -c merge.directoryRenames=conflict merge -s recursive B^0 >out &&- grep "CONFLICT (rename/delete).*A/file1.*D/file2" out &&- grep "CONFLICT (implicit dir rename).*Existing file/dir at A/file1 in the way" out &&+ test_grep "CONFLICT (rename/delete).*A/file1.*D/file2" out &&+ test_grep "CONFLICT (implicit dir rename).*Existing file/dir at A/file1 in the way" out && test_stdout_line_count = 6 git ls-files -s && test_stdout_line_count = 1 git ls-files -s A/other &&@@ -5586,7 +5586,7 @@ test_expect_success '12q: Directory rename hits other rename source; file remove # the dir rename of C/file1 -> A/file1 would mean modifying # the code so that renames do not adjust both their source # and target paths in all cases.- ! grep "CONFLICT (file location)" out &&+ test_grep ! "CONFLICT (file location)" out && test_stdout_line_count = 1 git ls-files -s C/file1 ) '@@ -5652,8 +5652,8 @@ test_expect_success '13a(conflict): messages for newly added files' ' test_grep CONFLICT..file.location.*z/d.added.in.B^0.*y/d out && git ls-files >paths &&- ! grep z/ paths &&- grep "y/[de]" paths &&+ test_grep ! z/ paths &&+ test_grep "y/[de]" paths && test_path_is_missing z/d && test_path_is_file y/d &&@@ -5676,8 +5676,8 @@ test_expect_success '13a(info): messages for newly added files' ' test_grep Path.updated:.*z/d.added.in.B^0.*y/d out && git ls-files >paths &&- ! grep z/ paths &&- grep "y/[de]" paths &&+ test_grep ! z/ paths &&+ test_grep "y/[de]" paths && test_path_is_missing z/d && test_path_is_file y/d &&@@ -5742,8 +5742,8 @@ test_expect_success '13b(conflict): messages for transitive rename with conflict test_grep CONFLICT..file.location.*x/d.renamed.to.z/d.*moved.to.y/d out && git ls-files >paths &&- ! grep z/ paths &&- grep "y/d" paths &&+ test_grep ! z/ paths &&+ test_grep "y/d" paths && test_path_is_missing z/d && test_path_is_file y/d@@ -5764,8 +5764,8 @@ test_expect_success '13b(info): messages for transitive rename with conflicted c test_grep Path.updated:.*x/d.renamed.to.z/d.in.B^0.*moving.it.to.y/d out && git ls-files >paths &&- ! grep z/ paths &&- grep "y/d" paths &&+ test_grep ! z/ paths &&+ test_grep "y/d" paths && test_path_is_missing z/d && test_path_is_file y/d@@ -5827,8 +5827,8 @@ test_expect_success '13c(conflict): messages for rename/rename(1to1) via transit test_grep CONFLICT..file.location.*x/d.renamed.to.z/d.*moved.to.y/d out && git ls-files >paths &&- ! grep z/ paths &&- grep "y/d" paths &&+ test_grep ! z/ paths &&+ test_grep "y/d" paths && test_path_is_missing z/d && test_path_is_file y/d@@ -5848,8 +5848,8 @@ test_expect_success '13c(info): messages for rename/rename(1to1) via transitive test_grep Path.updated:.*x/d.renamed.to.z/d.in.B^0.*moving.it.to.y/d out && git ls-files >paths &&- ! grep z/ paths &&- grep "y/d" paths &&+ test_grep ! z/ paths &&+ test_grep "y/d" paths && test_path_is_missing z/d && test_path_is_file y/d@@ -5917,9 +5917,9 @@ test_expect_success '13d(conflict): messages for rename/rename(1to1) via dual tr test_grep CONFLICT..file.location.*a/y.renamed.to.c/y.*moved.to.d/y out && git ls-files >paths &&- ! grep b/ paths &&- ! grep c/ paths &&- grep "d/y" paths &&+ test_grep ! b/ paths &&+ test_grep ! c/ paths &&+ test_grep "d/y" paths && test_path_is_missing b/y && test_path_is_missing c/y &&@@ -5941,9 +5941,9 @@ test_expect_success '13d(info): messages for rename/rename(1to1) via dual transi test_grep Path.updated.*a/y.renamed.to.c/y.*moving.it.to.d/y out && git ls-files >paths &&- ! grep b/ paths &&- ! grep c/ paths &&- grep "d/y" paths &&+ test_grep ! b/ paths &&+ test_grep ! c/ paths &&+ test_grep "d/y" paths && test_path_is_missing b/y && test_path_is_missing c/y &&@@ -6058,8 +6058,8 @@ test_expect_success '13e: directory rename detection in recursive case' ' test_must_be_empty err && git ls-files >paths &&- ! grep a/x paths &&- grep b/x paths+ test_grep ! a/x paths &&+ test_grep b/x paths ) '
t/t6424-merge-unrelated-index-changes.sh
+3-3
index ddc7524f6c..12e58bc335 100755--- a/t/t6424-merge-unrelated-index-changes.sh+++ b/t/t6424-merge-unrelated-index-changes.sh@@ -298,9 +298,9 @@ test_expect_success 'with multiple strategies, recursive or ort failure do not e test_must_fail git merge -s ort -s octopus C^0 >output 2>&1 &&- grep "Trying merge strategy ort..." output &&- grep "Trying merge strategy octopus..." output &&- grep "No merge strategy handled the merge." output &&+ test_grep "Trying merge strategy ort..." output &&+ test_grep "Trying merge strategy octopus..." output &&+ test_grep "No merge strategy handled the merge." output && # Changes to "a" should remain staged git rev-parse :a >actual &&
index 70b5d2d694..5e39a15fac 100755--- a/t/t6436-merge-overwrite.sh+++ b/t/t6436-merge-overwrite.sh@@ -189,10 +189,10 @@ test_expect_success 'set up unborn branch and content' ' test_expect_success 'will not clobber WT/index when merging into unborn' ' git merge main &&- grep foo tracked-file &&+ test_grep foo tracked-file && git show :tracked-file >expect &&- grep foo expect &&- grep bar untracked-file+ test_grep foo expect &&+ test_grep bar untracked-file ' test_done
t/t6437-submodule-merge.sh
+5-5
index a564758f52..107e13afbc 100755--- a/t/t6437-submodule-merge.sh+++ b/t/t6437-submodule-merge.sh@@ -111,7 +111,7 @@ test_expect_success 'merging should conflict for non fast-forward' ' git checkout -b test-nonforward-a b && test_must_fail git merge c 2>actual && sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&- grep "$sub_expect" actual+ test_grep "$sub_expect" actual ) '@@ -148,7 +148,7 @@ test_expect_success 'merging should conflict for non fast-forward (resolution ex git rev-parse --short sub-d > ../expect) && test_must_fail git merge c >actual 2>sub-actual && sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&- grep "$sub_expect" sub-actual &&+ test_grep "$sub_expect" sub-actual && grep $(cat expect) actual > /dev/null && git reset --hard) '@@ -164,7 +164,7 @@ test_expect_success 'merging should fail for ambiguous common parent' ' ) && test_must_fail git merge c >actual 2>sub-actual && sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&- grep "$sub_expect" sub-actual &&+ test_grep "$sub_expect" sub-actual && grep $(cat expect1) actual > /dev/null && grep $(cat expect2) actual > /dev/null && git reset --hard)@@ -207,7 +207,7 @@ test_expect_success 'merging should fail for changes that are backwards' ' git checkout -b test-backward e && test_must_fail git merge f 2>actual && sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-d)" &&- grep "$sub_expect" actual+ test_grep "$sub_expect" actual ) '@@ -513,7 +513,7 @@ test_expect_success 'merging should fail with no merge base' ' git commit -m "b" && test_must_fail git merge a 2>actual && sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short HEAD^1)" &&- grep "$sub_expect" actual+ test_grep "$sub_expect" actual ) '
t/t6500-gc.sh
+4-4
index ea9aaad470..3ee4b18d88 100755--- a/t/t6500-gc.sh+++ b/t/t6500-gc.sh@@ -176,15 +176,15 @@ test_expect_success 'gc.reflogExpire{Unreachable,}=never skips "expire" via "gc" # Check that git-pack-refs is run as a sanity check (done via # gc_before_repack()) but that git-expire is not.- grep -E "^trace: (built-in|exec|run_command): git pack-refs --" trace.out &&- ! grep -E "^trace: (built-in|exec|run_command): git reflog expire --" trace.out+ test_grep -E "^trace: (built-in|exec|run_command): git pack-refs --" trace.out &&+ test_grep ! -E "^trace: (built-in|exec|run_command): git reflog expire --" trace.out ' test_expect_success 'one of gc.reflogExpire{Unreachable,}=never does not skip "expire" via "gc"' ' >trace.out && test_config gc.reflogExpire never && GIT_TRACE=$(pwd)/trace.out git gc &&- grep -E "^trace: (built-in|exec|run_command): git reflog expire --" trace.out+ test_grep -E "^trace: (built-in|exec|run_command): git reflog expire --" trace.out ' test_expect_success 'gc.repackFilter launches repack with a filter' '@@ -196,7 +196,7 @@ test_expect_success 'gc.repackFilter launches repack with a filter' ' GIT_TRACE=$(pwd)/trace.out git -C bare.git -c gc.repackFilter=blob:none \ -c repack.writeBitmaps=false -c gc.cruftPacks=false gc && test_stdout_line_count = 2 ls bare.git/objects/pack/*.pack &&- grep -E "^trace: (built-in|exec|run_command): git repack .* --filter=blob:none ?.*" trace.out+ test_grep -E "^trace: (built-in|exec|run_command): git repack .* --filter=blob:none ?.*" trace.out ' test_expect_success 'gc.repackFilterTo store filtered out objects' '
t/t6600-test-reach.sh
+2-2
index b5b314e570..ee46d66b84 100755--- a/t/t6600-test-reach.sh+++ b/t/t6600-test-reach.sh@@ -958,13 +958,13 @@ test_expect_success 'merge-base without --all is one of --all results' ' git merge-base --all commit-5-7 commit-4-8 commit-6-6 commit-8-3 >all && git merge-base commit-5-7 commit-4-8 commit-6-6 commit-8-3 >single && test_line_count = 1 single &&- grep -F -f single all &&+ test_grep -F -f single all && cp commit-graph-half .git/objects/info/commit-graph && git merge-base --all commit-5-7 commit-4-8 commit-6-6 commit-8-3 >all && git merge-base commit-5-7 commit-4-8 commit-6-6 commit-8-3 >single && test_line_count = 1 single &&- grep -F -f single all+ test_grep -F -f single all ' test_done
t/t7001-mv.sh
+8-8
index 920479e925..7cf4aa5ba1 100755--- a/t/t7001-mv.sh+++ b/t/t7001-mv.sh@@ -46,7 +46,7 @@ test_expect_success 'commiting the change' ' test_expect_success 'checking the commit' ' git diff-tree -r -M --name-status HEAD^ HEAD >actual &&- grep "^R100..*path0/COPYING..*path1/COPYING" actual+ test_grep "^R100..*path0/COPYING..*path1/COPYING" actual ' test_expect_success 'moving the file back into subdirectory' '@@ -60,7 +60,7 @@ test_expect_success 'commiting the change' ' test_expect_success 'checking the commit' ' git diff-tree -r -M --name-status HEAD^ HEAD >actual &&- grep "^R100..*path1/COPYING..*path0/COPYING" actual+ test_grep "^R100..*path1/COPYING..*path0/COPYING" actual ' test_expect_success 'mv --dry-run does not move file' '@@ -147,8 +147,8 @@ test_expect_success 'commiting the change' ' test_expect_success 'checking the commit' ' git diff-tree -r -M --name-status HEAD^ HEAD >actual &&- grep "^R100..*path0/COPYING..*path2/COPYING" actual &&- grep "^R100..*path0/README..*path2/README" actual+ test_grep "^R100..*path0/COPYING..*path2/COPYING" actual &&+ test_grep "^R100..*path0/README..*path2/README" actual ' test_expect_success 'succeed when source is a prefix of destination' '@@ -165,8 +165,8 @@ test_expect_success 'commiting the change' ' test_expect_success 'checking the commit' ' git diff-tree -r -M --name-status HEAD^ HEAD >actual &&- grep "^R100..*path2/COPYING..*path1/path2/COPYING" actual &&- grep "^R100..*path2/README..*path1/path2/README" actual+ test_grep "^R100..*path2/COPYING..*path1/path2/COPYING" actual &&+ test_grep "^R100..*path2/README..*path1/path2/README" actual ' test_expect_success 'do not move directory over existing directory' '@@ -200,7 +200,7 @@ test_expect_success "Michael Cassar's test case" ' T=$(git write-tree) && git ls-tree -r $T >out &&- grep partA/outline.txt out+ test_grep partA/outline.txt out ' rm -fr papers partA path?@@ -504,7 +504,7 @@ test_expect_success 'mv -k does not accidentally destroy submodules' ' mkdir dummy dest && git mv -k dummy sub dest && git status --porcelain >actual &&- grep "^R sub -> dest/sub" actual &&+ test_grep "^R sub -> dest/sub" actual && git reset --hard && git checkout . '
t/t7002-mv-sparse-checkout.sh
+19-19
index 4d3f221224..9c0e82ba31 100755--- a/t/t7002-mv-sparse-checkout.sh+++ b/t/t7002-mv-sparse-checkout.sh@@ -319,8 +319,8 @@ test_expect_success 'move clean path from in-cone to out-of-cone' ' test_path_is_missing sub/d && test_path_is_missing folder1/d && git ls-files -t >actual &&- ! grep "^H sub/d\$" actual &&- grep "S folder1/d" actual+ test_grep ! "^H sub/d\$" actual &&+ test_grep "S folder1/d" actual ' test_expect_success 'move clean path from in-cone to out-of-cone overwrite' '@@ -346,8 +346,8 @@ test_expect_success 'move clean path from in-cone to out-of-cone overwrite' ' test_path_is_missing sub/file1 && test_path_is_missing folder1/file1 && git ls-files -t >actual &&- ! grep "H sub/file1" actual &&- grep "S folder1/file1" actual &&+ test_grep ! "H sub/file1" actual &&+ test_grep "S folder1/file1" actual && # compare file content before move and after move echo "sub/file1 overwrite" >expect &&@@ -382,8 +382,8 @@ test_expect_success 'move clean path from in-cone to out-of-cone file overwrite' test_path_is_missing sub/file1 && test_path_is_missing folder1/file1 && git ls-files -t >actual &&- ! grep "H sub/file1" actual &&- grep "S folder1/file1" actual &&+ test_grep ! "H sub/file1" actual &&+ test_grep "S folder1/file1" actual && # compare file content before move and after move echo "sub/file1 overwrite" >expect &&@@ -421,9 +421,9 @@ test_expect_success 'move directory with one of the files overwrite' ' test_path_is_missing sub/dir/e && test_path_is_missing folder1/file1 && git ls-files -t >actual &&- ! grep "H sub/dir/file1" actual &&- ! grep "H sub/dir/e" actual &&- grep "S folder1/dir/file1" actual &&+ test_grep ! "H sub/dir/file1" actual &&+ test_grep ! "H sub/dir/e" actual &&+ test_grep "S folder1/dir/file1" actual && # compare file content before move and after move echo test >expect &&@@ -452,8 +452,8 @@ test_expect_success 'move dirty path from in-cone to out-of-cone' ' test_path_is_missing sub/d && test_path_is_file folder1/d && git ls-files -t >actual &&- ! grep "^H sub/d\$" actual &&- grep "H folder1/d" actual+ test_grep ! "^H sub/d\$" actual &&+ test_grep "H folder1/d" actual ' test_expect_success 'move dir from in-cone to out-of-cone' '@@ -473,8 +473,8 @@ test_expect_success 'move dir from in-cone to out-of-cone' ' test_path_is_missing sub/dir && test_path_is_missing folder1 && git ls-files -t >actual &&- ! grep "H sub/dir/e" actual &&- grep "S folder1/dir/e" actual+ test_grep ! "H sub/dir/e" actual &&+ test_grep "S folder1/dir/e" actual ' test_expect_success 'move partially-dirty dir from in-cone to out-of-cone' '@@ -506,12 +506,12 @@ test_expect_success 'move partially-dirty dir from in-cone to out-of-cone' ' test_path_is_file folder1/dir/e2 && test_path_is_file folder1/dir/e3 && git ls-files -t >actual &&- ! grep "H sub/dir/e" actual &&- ! grep "H sub/dir/e2" actual &&- ! grep "H sub/dir/e3" actual &&- grep "S folder1/dir/e" actual &&- grep "H folder1/dir/e2" actual &&- grep "H folder1/dir/e3" actual+ test_grep ! "H sub/dir/e" actual &&+ test_grep ! "H sub/dir/e2" actual &&+ test_grep ! "H sub/dir/e3" actual &&+ test_grep "S folder1/dir/e" actual &&+ test_grep "H folder1/dir/e2" actual &&+ test_grep "H folder1/dir/e3" actual ' test_done
t/t7003-filter-branch.sh
+8-8
index c475769858..86011e7b1f 100755--- a/t/t7003-filter-branch.sh+++ b/t/t7003-filter-branch.sh@@ -49,7 +49,7 @@ test_expect_success 'result is really identical' ' test_expect_success 'rewrite bare repository identically' ' (git config core.bare true && cd .git && git filter-branch branch > filter-output 2>&1 &&- ! grep fatal filter-output)+ test_grep ! fatal filter-output) ' git config core.bare false test_expect_success 'result is really identical' '@@ -65,7 +65,7 @@ test_expect_success 'correct GIT_DIR while using -d' ' git filter-branch -d "$TRASHDIR/dfoo" \ --index-filter "cp \"$TRASHDIR\"/dfoo/backup-refs \"$TRASHDIR\"" \ ) &&- grep drepo "$TRASHDIR/backup-refs"+ test_grep drepo "$TRASHDIR/backup-refs" ' test_expect_success 'tree-filter works with -d' '@@ -503,7 +503,7 @@ test_expect_success 'rewrite repository including refs that point at non-commit git tag -a -m "tag to a tree" treetag $new_tree && git reset --hard HEAD && git filter-branch -f -- --all >filter-output 2>&1 &&- ! grep fatal filter-output+ test_grep ! fatal filter-output ' test_expect_success 'filter-branch handles ref deletion' '@@ -512,7 +512,7 @@ test_expect_success 'filter-branch handles ref deletion' ' git tag empty && git branch to-delete && git filter-branch -f --prune-empty to-delete >out 2>&1 &&- grep "to-delete.*was deleted" out &&+ test_grep "to-delete.*was deleted" out && test_must_fail git rev-parse --verify to-delete '@@ -523,8 +523,8 @@ test_expect_success 'filter-branch handles ref rewrite' ' git filter-branch -f \ --index-filter "git rm --ignore-unmatch --cached to-drop.t" \ rewrite >out 2>&1 &&- grep "rewrite.*was rewritten" out &&- ! grep -i warning out &&+ test_grep "rewrite.*was rewritten" out &&+ test_grep ! -i warning out && git diff-tree empty rewrite '@@ -532,8 +532,8 @@ test_expect_success 'filter-branch handles ancestor rewrite' ' test_commit to-exclude && git branch ancestor && git filter-branch -f ancestor -- :^to-exclude.t >out 2>&1 &&- grep "ancestor.*was rewritten" out &&- ! grep -i warning out &&+ test_grep "ancestor.*was rewritten" out &&+ test_grep ! -i warning out && git diff-tree HEAD^ ancestor '
t/t7004-tag.sh
+1-1
index d918005dd9..2ad30040df 100755--- a/t/t7004-tag.sh+++ b/t/t7004-tag.sh@@ -937,7 +937,7 @@ test_expect_success 'git tag --format with ahead-behind' ' test_cmp expect actual.focus && # Error reported for tags that point to non-commits.- grep "error: object [0-9a-f]* is a blob, not a commit" err+ test_grep "error: object [0-9a-f]* is a blob, not a commit" err ' # trying to verify annotated non-signed tags:
index acdb6b1455..8e9d8ff3ae 100755--- a/t/t7507-commit-verbose.sh+++ b/t/t7507-commit-verbose.sh@@ -106,13 +106,13 @@ test_expect_success 'verbose diff is stripped with multi-byte comment char' ' export GIT_EDITOR && test_must_fail git -c core.commentchar="foo>" commit -a -v >out 2>err ) &&- grep "^foo> " out &&+ test_grep "^foo> " out && test_grep "Aborting commit due to empty commit message." err ' test_expect_success 'status does not verbose without --verbose' ' git status >actual &&- ! grep "^diff --git" actual+ test_grep ! "^diff --git" actual ' test_expect_success 'setup -v -v' '@@ -163,7 +163,7 @@ done test_expect_success "status ignores commit.verbose=true" ' git -c commit.verbose=true status >actual &&- ! grep "^diff --git" actual+ test_grep ! "^diff --git" actual ' test_done
t/t7508-status.sh
+3-3
index c2057bc94c..c37ffbe444 100755--- a/t/t7508-status.sh+++ b/t/t7508-status.sh@@ -863,7 +863,7 @@ test_expect_success 'status -s without relative paths' ' test_cmp expect output && git status -s --ignored >output &&- grep "^!! \"expect with spaces\"$" output &&+ test_grep "^!! \"expect with spaces\"$" output && grep -v "^!! " output >output-wo-ignored && test_cmp expect output-wo-ignored '@@ -908,7 +908,7 @@ test_expect_success 'status shows detached HEAD properly after checking out non- git clone upstream downstream && git -C downstream checkout @{u} && git -C downstream status >actual &&- grep -E "HEAD detached at [0-9a-f]+" actual+ test_grep -E "HEAD detached at [0-9a-f]+" actual ' test_expect_success 'setup status submodule summary' '@@ -1127,7 +1127,7 @@ test_expect_success POSIXPERM,SANITY 'status succeeds in a read-only repository' # make dir1/tracked stat-dirty >dir1/tracked1 && mv -f dir1/tracked1 dir1/tracked && git status -s >output &&- ! grep dir1/tracked output &&+ test_grep ! dir1/tracked output && # make sure "status" succeeded without writing index out git diff-files | grep dir1/tracked )
t/t7510-signed-commit.sh
+34-34
index aa9108da54..67c104a0f3 100755--- a/t/t7510-signed-commit.sh+++ b/t/t7510-signed-commit.sh@@ -89,8 +89,8 @@ test_expect_success GPG 'verify and show signatures' ' do git verify-commit $commit && git show --pretty=short --show-signature $commit >actual &&- grep "Good signature from" actual &&- ! grep "BAD signature from" actual &&+ test_grep "Good signature from" actual &&+ test_grep ! "BAD signature from" actual && echo $commit OK || exit 1 done ) &&@@ -100,8 +100,8 @@ test_expect_success GPG 'verify and show signatures' ' do test_must_fail git verify-commit $commit && git show --pretty=short --show-signature $commit >actual &&- ! grep "Good signature from" actual &&- ! grep "BAD signature from" actual &&+ test_grep ! "Good signature from" actual &&+ test_grep ! "BAD signature from" actual && echo $commit OK || exit 1 done ) &&@@ -109,9 +109,9 @@ test_expect_success GPG 'verify and show signatures' ' for commit in eighth-signed-alt twelfth-signed-alt do git show --pretty=short --show-signature $commit >actual &&- grep "Good signature from" actual &&- ! grep "BAD signature from" actual &&- grep "not certified" actual &&+ test_grep "Good signature from" actual &&+ test_grep ! "BAD signature from" actual &&+ test_grep "not certified" actual && echo $commit OK || exit 1 done )@@ -119,16 +119,16 @@ test_expect_success GPG 'verify and show signatures' ' test_expect_success GPG 'verify-commit exits failure on unknown signature' ' test_must_fail env GNUPGHOME="$GNUPGHOME_NOT_USED" git verify-commit initial 2>actual &&- ! grep "Good signature from" actual &&- ! grep "BAD signature from" actual &&- grep -q -F -e "No public key" -e "public key not found" actual+ test_grep ! "Good signature from" actual &&+ test_grep ! "BAD signature from" actual &&+ test_grep -q -F -e "No public key" -e "public key not found" actual ' test_expect_success GPG 'verify-commit exits success on untrusted signature' ' git verify-commit eighth-signed-alt 2>actual &&- grep "Good signature from" actual &&- ! grep "BAD signature from" actual &&- grep "not certified" actual+ test_grep "Good signature from" actual &&+ test_grep ! "BAD signature from" actual &&+ test_grep "not certified" actual ' test_expect_success GPG 'verify-commit exits success with matching minTrustLevel' '@@ -151,8 +151,8 @@ test_expect_success GPG 'verify signatures with --raw' ' for commit in initial second merge fourth-signed fifth-signed sixth-signed seventh-signed do git verify-commit --raw $commit 2>actual &&- grep "GOODSIG" actual &&- ! grep "BADSIG" actual &&+ test_grep "GOODSIG" actual &&+ test_grep ! "BADSIG" actual && echo $commit OK || exit 1 done ) &&@@ -160,8 +160,8 @@ test_expect_success GPG 'verify signatures with --raw' ' for commit in merge^2 fourth-unsigned sixth-unsigned seventh-unsigned do test_must_fail git verify-commit --raw $commit 2>actual &&- ! grep "GOODSIG" actual &&- ! grep "BADSIG" actual &&+ test_grep ! "GOODSIG" actual &&+ test_grep ! "BADSIG" actual && echo $commit OK || exit 1 done ) &&@@ -169,9 +169,9 @@ test_expect_success GPG 'verify signatures with --raw' ' for commit in eighth-signed-alt do git verify-commit --raw $commit 2>actual &&- grep "GOODSIG" actual &&- ! grep "BADSIG" actual &&- grep "TRUST_UNDEFINED" actual &&+ test_grep "GOODSIG" actual &&+ test_grep ! "BADSIG" actual &&+ test_grep "TRUST_UNDEFINED" actual && echo $commit OK || exit 1 done )@@ -179,7 +179,7 @@ test_expect_success GPG 'verify signatures with --raw' ' test_expect_success GPG 'proper header is used for hash algorithm' ' git cat-file commit fourth-signed >output &&- grep "^$(test_oid header) -----BEGIN PGP SIGNATURE-----" output+ test_grep "^$(test_oid header) -----BEGIN PGP SIGNATURE-----" output ' test_expect_success GPG 'show signed commit with signature' '@@ -201,8 +201,8 @@ test_expect_success GPG 'detect fudged signature' ' git hash-object -w -t commit forged1 >forged1.commit && test_must_fail git verify-commit $(cat forged1.commit) && git show --pretty=short --show-signature $(cat forged1.commit) >actual1 &&- grep "BAD signature from" actual1 &&- ! grep "Good signature from" actual1+ test_grep "BAD signature from" actual1 &&+ test_grep ! "Good signature from" actual1 ' test_expect_success GPG 'detect fudged signature with NUL' '@@ -212,8 +212,8 @@ test_expect_success GPG 'detect fudged signature with NUL' ' git hash-object --literally -w -t commit forged2 >forged2.commit && test_must_fail git verify-commit $(cat forged2.commit) && git show --pretty=short --show-signature $(cat forged2.commit) >actual2 &&- grep "BAD signature from" actual2 &&- ! grep "Good signature from" actual2+ test_grep "BAD signature from" actual2 &&+ test_grep ! "Good signature from" actual2 ' test_expect_success GPG 'amending already signed commit' '@@ -221,8 +221,8 @@ test_expect_success GPG 'amending already signed commit' ' git commit --amend -S --no-edit && git verify-commit HEAD && git show -s --show-signature HEAD >actual &&- grep "Good signature from" actual &&- ! grep "BAD signature from" actual+ test_grep "Good signature from" actual &&+ test_grep ! "BAD signature from" actual ' test_expect_success GPG2 'bare signature' '@@ -326,8 +326,8 @@ test_expect_success GPG 'show lack of signature with custom format' ' test_expect_success GPG 'log.showsignature behaves like --show-signature' ' test_config log.showsignature true && git show initial >actual &&- grep "gpg: Signature made" actual &&- grep "gpg: Good signature" actual+ test_grep "gpg: Signature made" actual &&+ test_grep "gpg: Good signature" actual ' test_expect_success GPG 'check config gpg.format values' '@@ -349,8 +349,8 @@ test_expect_success GPG 'detect fudged commit with double signature' ' git hash-object -w -t commit double-commit >double-commit.commit && test_must_fail git verify-commit $(cat double-commit.commit) && git show --pretty=short --show-signature $(cat double-commit.commit) >double-actual &&- grep "BAD signature from" double-actual &&- grep "Good signature from" double-actual+ test_grep "BAD signature from" double-actual &&+ test_grep "Good signature from" double-actual ' test_expect_success GPG 'show double signature with custom format' '@@ -404,8 +404,8 @@ test_expect_success GPG 'verify-commit verifies multiply signed commits' ' head=$(git hash-object -t commit -w commit) && git reset --hard $head && git verify-commit $head 2>actual &&- grep "Good signature from" actual &&- ! grep "BAD signature from" actual+ test_grep "Good signature from" actual &&+ test_grep ! "BAD signature from" actual ' test_expect_success 'custom `gpg.program`' '@@ -449,7 +449,7 @@ test_expect_success 'custom `gpg.program`' ' test_must_fail env LET_GPG_PROGRAM_FAIL=1 \ git commit -S --allow-empty -m must-fail 2>err &&- grep zOMG err &&+ test_grep zOMG err && # `gpg.program` starts with `~`, the path should be interpreted to be relative to `$HOME` test_config gpg.program "~/fake-gpg" &&
t/t7516-commit-races.sh
+2-2
index de7c4ca790..29669f64ae 100755--- a/t/t7516-commit-races.sh+++ b/t/t7516-commit-races.sh@@ -10,7 +10,7 @@ test_expect_success 'race to create orphan commit' ' EOF test_must_fail env EDITOR=./hare-editor git commit --allow-empty -m tortoise -e && git show -s --pretty=format:%s >subject &&- grep hare subject &&+ test_grep hare subject && git show -s --pretty=format:%P >out && test_must_be_empty out '@@ -24,7 +24,7 @@ test_expect_success 'race to create non-orphan commit' ' git rev-parse HEAD >base && test_must_fail env EDITOR=./airplane-editor git commit --allow-empty -m ship -e && git show -s --pretty=format:%s >subject &&- grep airplane subject &&+ test_grep airplane subject && git rev-parse HEAD^ >parent && test_cmp base parent '
t/t7519-status-fsmonitor.sh
+7-7
index 7ee69ecdd4..93973ed25a 100755--- a/t/t7519-status-fsmonitor.sh+++ b/t/t7519-status-fsmonitor.sh@@ -63,19 +63,19 @@ test_expect_success 'incompatible bare repo' ' test_must_fail \ git -C ./bare-clone -c core.fsmonitor=foo \ update-index --fsmonitor 2>actual &&- grep "bare repository .* is incompatible with fsmonitor" actual &&+ test_grep "bare repository .* is incompatible with fsmonitor" actual && test_must_fail \ git -C ./bare-clone -c core.fsmonitor=true \ update-index --fsmonitor 2>actual &&- grep "bare repository .* is incompatible with fsmonitor" actual+ test_grep "bare repository .* is incompatible with fsmonitor" actual ' test_expect_success FSMONITOR_DAEMON 'run fsmonitor-daemon in bare repo' ' test_when_finished "rm -rf ./bare-clone actual" && git init --bare bare-clone && test_must_fail git -C ./bare-clone fsmonitor--daemon run 2>actual &&- grep "bare repository .* is incompatible with fsmonitor" actual+ test_grep "bare repository .* is incompatible with fsmonitor" actual ' test_expect_success MINGW,FSMONITOR_DAEMON 'run fsmonitor-daemon in virtual repo' '@@ -84,7 +84,7 @@ test_expect_success MINGW,FSMONITOR_DAEMON 'run fsmonitor-daemon in virtual repo test_must_fail git -C ./fake-virtual-clone \ -c core.virtualfilesystem=true \ fsmonitor--daemon run 2>actual &&- grep "virtual repository .* is incompatible with fsmonitor" actual+ test_grep "virtual repository .* is incompatible with fsmonitor" actual ' test_expect_success 'setup' '@@ -111,21 +111,21 @@ test_expect_success 'setup' ' # test that the fsmonitor extension is off by default test_expect_success 'fsmonitor extension is off by default' ' test-tool dump-fsmonitor >actual &&- grep "^no fsmonitor" actual+ test_grep "^no fsmonitor" actual ' # test that "update-index --fsmonitor" adds the fsmonitor extension test_expect_success 'update-index --fsmonitor" adds the fsmonitor extension' ' git update-index --fsmonitor && test-tool dump-fsmonitor >actual &&- grep "^fsmonitor last update" actual+ test_grep "^fsmonitor last update" actual ' # test that "update-index --no-fsmonitor" removes the fsmonitor extension test_expect_success 'update-index --no-fsmonitor" removes the fsmonitor extension' ' git update-index --no-fsmonitor && test-tool dump-fsmonitor >actual &&- grep "^no fsmonitor" actual+ test_grep "^no fsmonitor" actual ' cat >expect <<EOF &&
t/t7527-builtin-fsmonitor.sh
+41-41
index b63c162f9b..86bf3e6634 100755--- a/t/t7527-builtin-fsmonitor.sh+++ b/t/t7527-builtin-fsmonitor.sh@@ -157,7 +157,7 @@ test_expect_success 'implicit daemon start' ' GIT_TRACE2_EVENT="$PWD/.git/trace" \ test-tool -C test_implicit fsmonitor-client query --token 0 >actual && nul_to_q <actual >actual.filtered &&- grep "builtin:" actual.filtered &&+ test_grep "builtin:" actual.filtered && # confirm that a daemon was started in the background. #@@ -311,7 +311,7 @@ test_expect_success 'cannot start multiple daemons' ' start_daemon -C test_multiple && test_must_fail git -C test_multiple fsmonitor--daemon start 2>actual &&- grep "fsmonitor--daemon is already running" actual &&+ test_grep "fsmonitor--daemon is already running" actual && git -C test_multiple fsmonitor--daemon stop && test_must_fail git -C test_multiple fsmonitor--daemon status@@ -621,7 +621,7 @@ test_expect_success 'flush cached data' ' test-tool -C test_flush fsmonitor-client query --token "builtin:test_00000001:0" >actual_1 && nul_to_q <actual_1 >actual_q1 &&- grep "file_1" actual_q1 &&+ test_grep "file_1" actual_q1 && # Force a flush. This will change the <token_id>, reset the <seq_nr>, and # flush the file data. Then create some events and ensure that the file@@ -629,19 +629,19 @@ test_expect_success 'flush cached data' ' test-tool -C test_flush fsmonitor-client flush >flush_0 && nul_to_q <flush_0 >flush_q0 &&- grep "^builtin:test_00000002:0Q/Q$" flush_q0 &&+ test_grep "^builtin:test_00000002:0Q/Q$" flush_q0 && test-tool -C test_flush fsmonitor-client query --token "builtin:test_00000002:0" >actual_2 && nul_to_q <actual_2 >actual_q2 &&- grep "^builtin:test_00000002:0Q$" actual_q2 &&+ test_grep "^builtin:test_00000002:0Q$" actual_q2 && >test_flush/file_3 && test-tool -C test_flush fsmonitor-client query --token "builtin:test_00000002:0" >actual_3 && nul_to_q <actual_3 >actual_q3 &&- grep "file_3" actual_q3+ test_grep "file_3" actual_q3 ' # The next few test cases create repos where the .git directory is NOT@@ -814,7 +814,7 @@ do start_daemon -C "$u" && git -C "$u" status >actual &&- grep "new file: file1" actual+ test_grep "new file: file1" actual ' done@@ -1068,9 +1068,9 @@ test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' ' # directories and files that we touched. We may or may not get a # trailing slash on modified directories. #- grep -E "^event: abc/?$" ./insensitive.trace &&- grep -E "^event: abc/def/?$" ./insensitive.trace &&- grep -E "^event: abc/def/xyz$" ./insensitive.trace+ test_grep -E "^event: abc/?$" ./insensitive.trace &&+ test_grep -E "^event: abc/def/?$" ./insensitive.trace &&+ test_grep -E "^event: abc/def/xyz$" ./insensitive.trace ' # The variable "unicode_debug" is defined in the following library@@ -1112,20 +1112,20 @@ test_expect_success !UNICODE_COMPOSITION_SENSITIVE 'Unicode nfc/nfd' ' then # We should have seen NFC event from OS. # We should not have synthesized an NFD event.- grep -E "^event: nfc/c_${utf8_nfc}/?$" ./unicode.trace &&- grep -E -v "^event: nfc/c_${utf8_nfd}/?$" ./unicode.trace+ test_grep -E "^event: nfc/c_${utf8_nfc}/?$" ./unicode.trace &&+ test_grep -E -v "^event: nfc/c_${utf8_nfd}/?$" ./unicode.trace else # We should have seen NFD event from OS. # We should have synthesized an NFC event.- grep -E "^event: nfc/c_${utf8_nfd}/?$" ./unicode.trace &&- grep -E "^event: nfc/c_${utf8_nfc}/?$" ./unicode.trace+ test_grep -E "^event: nfc/c_${utf8_nfd}/?$" ./unicode.trace &&+ test_grep -E "^event: nfc/c_${utf8_nfc}/?$" ./unicode.trace fi && # We assume UNICODE_NFD_PRESERVED. # We should have seen explicit NFD from OS. # We should have synthesized an NFC event.- grep -E "^event: nfd/d_${utf8_nfd}/?$" ./unicode.trace &&- grep -E "^event: nfd/d_${utf8_nfc}/?$" ./unicode.trace+ test_grep -E "^event: nfd/d_${utf8_nfd}/?$" ./unicode.trace &&+ test_grep -E "^event: nfd/d_${utf8_nfc}/?$" ./unicode.trace ' test_expect_success 'split-index and FSMonitor work well together' '@@ -1239,21 +1239,21 @@ test_expect_success CASE_INSENSITIVE_FS 'fsmonitor subdir case wrong on disk' ' <"$PWD/subdir_case_wrong.log" \ >"$PWD/subdir_case_wrong.log1" &&- grep -q "AAA.*pos 0" "$PWD/subdir_case_wrong.log1" &&- grep -q "zzz.*pos 6" "$PWD/subdir_case_wrong.log1" &&+ test_grep -q "AAA.*pos 0" "$PWD/subdir_case_wrong.log1" &&+ test_grep -q "zzz.*pos 6" "$PWD/subdir_case_wrong.log1" &&- grep -q "dir1/DIR2/dir3/file3.*pos -3" "$PWD/subdir_case_wrong.log1" &&+ test_grep -q "dir1/DIR2/dir3/file3.*pos -3" "$PWD/subdir_case_wrong.log1" && # Verify that we get a mapping event to correct the case.- grep -q "MAP:.*dir1/DIR2/dir3/file3.*dir1/dir2/dir3/file3" \+ test_grep -q "MAP:.*dir1/DIR2/dir3/file3.*dir1/dir2/dir3/file3" \ "$PWD/subdir_case_wrong.log1" && # The refresh-callbacks should have caused "git status" to clear # the CE_FSMONITOR_VALID bit on each of those files and caused # the worktree scan to visit them and mark them as modified.- grep -q " M AAA" "$PWD/subdir_case_wrong.out" &&- grep -q " M zzz" "$PWD/subdir_case_wrong.out" &&- grep -q " M dir1/dir2/dir3/file3" "$PWD/subdir_case_wrong.out"+ test_grep -q " M AAA" "$PWD/subdir_case_wrong.out" &&+ test_grep -q " M zzz" "$PWD/subdir_case_wrong.out" &&+ test_grep -q " M dir1/dir2/dir3/file3" "$PWD/subdir_case_wrong.out" ' test_expect_success CASE_INSENSITIVE_FS 'fsmonitor file case wrong on disk' '@@ -1326,10 +1326,10 @@ test_expect_success CASE_INSENSITIVE_FS 'fsmonitor file case wrong on disk' ' GIT_TRACE_FSMONITOR="$PWD/file_case_wrong-try1.log" \ git -C file_case_wrong status --short \ >"$PWD/file_case_wrong-try1.out" &&- grep -q "fsmonitor_refresh_callback.*FILE-3-A.*pos -3" "$PWD/file_case_wrong-try1.log" &&- grep -q "fsmonitor_refresh_callback.*file-3-a.*pos 4" "$PWD/file_case_wrong-try1.log" &&- grep -q "fsmonitor_refresh_callback.*FILE-4-A.*pos 6" "$PWD/file_case_wrong-try1.log" &&- grep -q "fsmonitor_refresh_callback.*file-4-a.*pos -9" "$PWD/file_case_wrong-try1.log" &&+ test_grep -q "fsmonitor_refresh_callback.*FILE-3-A.*pos -3" "$PWD/file_case_wrong-try1.log" &&+ test_grep -q "fsmonitor_refresh_callback.*file-3-a.*pos 4" "$PWD/file_case_wrong-try1.log" &&+ test_grep -q "fsmonitor_refresh_callback.*FILE-4-A.*pos 6" "$PWD/file_case_wrong-try1.log" &&+ test_grep -q "fsmonitor_refresh_callback.*file-4-a.*pos -9" "$PWD/file_case_wrong-try1.log" && # FSM refresh will have invalidated the FSM bit and cause a regular # (real) scan of these tracked files, so they should have "H" status.@@ -1337,8 +1337,8 @@ test_expect_success CASE_INSENSITIVE_FS 'fsmonitor file case wrong on disk' ' # command).) git -C file_case_wrong ls-files -f >"$PWD/file_case_wrong-lsf1.out" &&- grep -q "H dir1/dir2/dir3/file-3-a" "$PWD/file_case_wrong-lsf1.out" &&- grep -q "H dir1/dir2/dir4/FILE-4-A" "$PWD/file_case_wrong-lsf1.out" &&+ test_grep -q "H dir1/dir2/dir3/file-3-a" "$PWD/file_case_wrong-lsf1.out" &&+ test_grep -q "H dir1/dir2/dir4/FILE-4-A" "$PWD/file_case_wrong-lsf1.out" && # Try the status again. We assume that the above status command@@ -1347,17 +1347,17 @@ test_expect_success CASE_INSENSITIVE_FS 'fsmonitor file case wrong on disk' ' GIT_TRACE_FSMONITOR="$PWD/file_case_wrong-try2.log" \ git -C file_case_wrong status --short \ >"$PWD/file_case_wrong-try2.out" &&- ! grep -q "fsmonitor_refresh_callback.*FILE-3-A.*pos" "$PWD/file_case_wrong-try2.log" &&- ! grep -q "fsmonitor_refresh_callback.*file-3-a.*pos" "$PWD/file_case_wrong-try2.log" &&- ! grep -q "fsmonitor_refresh_callback.*FILE-4-A.*pos" "$PWD/file_case_wrong-try2.log" &&- ! grep -q "fsmonitor_refresh_callback.*file-4-a.*pos" "$PWD/file_case_wrong-try2.log" &&+ test_grep ! -q "fsmonitor_refresh_callback.*FILE-3-A.*pos" "$PWD/file_case_wrong-try2.log" &&+ test_grep ! -q "fsmonitor_refresh_callback.*file-3-a.*pos" "$PWD/file_case_wrong-try2.log" &&+ test_grep ! -q "fsmonitor_refresh_callback.*FILE-4-A.*pos" "$PWD/file_case_wrong-try2.log" &&+ test_grep ! -q "fsmonitor_refresh_callback.*file-4-a.*pos" "$PWD/file_case_wrong-try2.log" && # FSM refresh saw nothing, so it will mark all files as valid, # so they should now have "h" status. git -C file_case_wrong ls-files -f >"$PWD/file_case_wrong-lsf2.out" &&- grep -q "h dir1/dir2/dir3/file-3-a" "$PWD/file_case_wrong-lsf2.out" &&- grep -q "h dir1/dir2/dir4/FILE-4-A" "$PWD/file_case_wrong-lsf2.out" &&+ test_grep -q "h dir1/dir2/dir3/file-3-a" "$PWD/file_case_wrong-lsf2.out" &&+ test_grep -q "h dir1/dir2/dir4/FILE-4-A" "$PWD/file_case_wrong-lsf2.out" && # We now have files with clean content, but with case-incorrect@@ -1372,20 +1372,20 @@ test_expect_success CASE_INSENSITIVE_FS 'fsmonitor file case wrong on disk' ' >"$PWD/file_case_wrong-try3.out" && # Verify that we get a mapping event to correct the case.- grep -q "fsmonitor_refresh_callback MAP:.*dir1/dir2/dir3/FILE-3-A.*dir1/dir2/dir3/file-3-a" \+ test_grep -q "fsmonitor_refresh_callback MAP:.*dir1/dir2/dir3/FILE-3-A.*dir1/dir2/dir3/file-3-a" \ "$PWD/file_case_wrong-try3.log" &&- grep -q "fsmonitor_refresh_callback MAP:.*dir1/dir2/dir4/file-4-a.*dir1/dir2/dir4/FILE-4-A" \+ test_grep -q "fsmonitor_refresh_callback MAP:.*dir1/dir2/dir4/file-4-a.*dir1/dir2/dir4/FILE-4-A" \ "$PWD/file_case_wrong-try3.log" && # FSEvents are in observed case.- grep -q "fsmonitor_refresh_callback.*FILE-3-A.*pos -3" "$PWD/file_case_wrong-try3.log" &&- grep -q "fsmonitor_refresh_callback.*file-4-a.*pos -9" "$PWD/file_case_wrong-try3.log" &&+ test_grep -q "fsmonitor_refresh_callback.*FILE-3-A.*pos -3" "$PWD/file_case_wrong-try3.log" &&+ test_grep -q "fsmonitor_refresh_callback.*file-4-a.*pos -9" "$PWD/file_case_wrong-try3.log" && # The refresh-callbacks should have caused "git status" to clear # the CE_FSMONITOR_VALID bit on each of those files and caused # the worktree scan to visit them and mark them as modified.- grep -q " M dir1/dir2/dir3/file-3-a" "$PWD/file_case_wrong-try3.out" &&- grep -q " M dir1/dir2/dir4/FILE-4-A" "$PWD/file_case_wrong-try3.out"+ test_grep -q " M dir1/dir2/dir3/file-3-a" "$PWD/file_case_wrong-try3.out" &&+ test_grep -q " M dir1/dir2/dir4/FILE-4-A" "$PWD/file_case_wrong-try3.out" ' test_done
t/t7528-signed-commit-ssh.sh
+34-34
index b50306b9b3..44396460e6 100755--- a/t/t7528-signed-commit-ssh.sh+++ b/t/t7528-signed-commit-ssh.sh@@ -133,8 +133,8 @@ test_expect_success GPGSSH 'verify and show signatures' ' do git verify-commit $commit && git show --pretty=short --show-signature $commit >actual &&- grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&- ! grep "${GPGSSH_BAD_SIGNATURE}" actual &&+ test_grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&+ test_grep ! "${GPGSSH_BAD_SIGNATURE}" actual && echo $commit OK || exit 1 done ) &&@@ -144,8 +144,8 @@ test_expect_success GPGSSH 'verify and show signatures' ' do test_must_fail git verify-commit $commit && git show --pretty=short --show-signature $commit >actual &&- ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&- ! grep "${GPGSSH_BAD_SIGNATURE}" actual &&+ test_grep ! "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&+ test_grep ! "${GPGSSH_BAD_SIGNATURE}" actual && echo $commit OK || exit 1 done ) &&@@ -153,9 +153,9 @@ test_expect_success GPGSSH 'verify and show signatures' ' for commit in eighth-signed-alt twelfth-signed-alt do git show --pretty=short --show-signature $commit >actual &&- grep "${GPGSSH_GOOD_SIGNATURE_UNTRUSTED}" actual &&- ! grep "${GPGSSH_BAD_SIGNATURE}" actual &&- grep "${GPGSSH_KEY_NOT_TRUSTED}" actual &&+ test_grep "${GPGSSH_GOOD_SIGNATURE_UNTRUSTED}" actual &&+ test_grep ! "${GPGSSH_BAD_SIGNATURE}" actual &&+ test_grep "${GPGSSH_KEY_NOT_TRUSTED}" actual && echo $commit OK || exit 1 done )@@ -164,34 +164,34 @@ test_expect_success GPGSSH 'verify and show signatures' ' test_expect_success GPGSSH 'verify-commit exits failure on untrusted signature' ' test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" && test_must_fail git verify-commit eighth-signed-alt 2>actual &&- grep "${GPGSSH_GOOD_SIGNATURE_UNTRUSTED}" actual &&- ! grep "${GPGSSH_BAD_SIGNATURE}" actual &&- grep "${GPGSSH_KEY_NOT_TRUSTED}" actual+ test_grep "${GPGSSH_GOOD_SIGNATURE_UNTRUSTED}" actual &&+ test_grep ! "${GPGSSH_BAD_SIGNATURE}" actual &&+ test_grep "${GPGSSH_KEY_NOT_TRUSTED}" actual ' test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'verify-commit exits failure on expired signature key' ' test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" && test_must_fail git verify-commit expired-signed 2>actual &&- ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual+ test_grep ! "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual ' test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'verify-commit exits failure on not yet valid signature key' ' test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" && test_must_fail git verify-commit notyetvalid-signed 2>actual &&- ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual+ test_grep ! "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual ' test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'verify-commit succeeds with commit date and key validity matching' ' test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" && git verify-commit timeboxedvalid-signed 2>actual &&- grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&- ! grep "${GPGSSH_BAD_SIGNATURE}" actual+ test_grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&+ test_grep ! "${GPGSSH_BAD_SIGNATURE}" actual ' test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'verify-commit exits failure with commit date outside of key validity' ' test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" && test_must_fail git verify-commit timeboxedinvalid-signed 2>actual &&- ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual+ test_grep ! "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual ' test_expect_success GPGSSH 'verify-commit exits success with matching minTrustLevel' '@@ -217,8 +217,8 @@ test_expect_success GPGSSH 'verify signatures with --raw' ' for commit in initial second merge fourth-signed fifth-signed sixth-signed seventh-signed do git verify-commit --raw $commit 2>actual &&- grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&- ! grep "${GPGSSH_BAD_SIGNATURE}" actual &&+ test_grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&+ test_grep ! "${GPGSSH_BAD_SIGNATURE}" actual && echo $commit OK || exit 1 done ) &&@@ -226,8 +226,8 @@ test_expect_success GPGSSH 'verify signatures with --raw' ' for commit in merge^2 fourth-unsigned sixth-unsigned seventh-unsigned do test_must_fail git verify-commit --raw $commit 2>actual &&- ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&- ! grep "${GPGSSH_BAD_SIGNATURE}" actual &&+ test_grep ! "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&+ test_grep ! "${GPGSSH_BAD_SIGNATURE}" actual && echo $commit OK || exit 1 done ) &&@@ -235,8 +235,8 @@ test_expect_success GPGSSH 'verify signatures with --raw' ' for commit in eighth-signed-alt do test_must_fail git verify-commit --raw $commit 2>actual &&- grep "${GPGSSH_GOOD_SIGNATURE_UNTRUSTED}" actual &&- ! grep "${GPGSSH_BAD_SIGNATURE}" actual &&+ test_grep "${GPGSSH_GOOD_SIGNATURE_UNTRUSTED}" actual &&+ test_grep ! "${GPGSSH_BAD_SIGNATURE}" actual && echo $commit OK || exit 1 done )@@ -244,7 +244,7 @@ test_expect_success GPGSSH 'verify signatures with --raw' ' test_expect_success GPGSSH 'proper header is used for hash algorithm' ' git cat-file commit fourth-signed >output &&- grep "^$(test_oid header) -----BEGIN SSH SIGNATURE-----" output+ test_grep "^$(test_oid header) -----BEGIN SSH SIGNATURE-----" output ' test_expect_success GPGSSH 'show signed commit with signature' '@@ -268,9 +268,9 @@ test_expect_success GPGSSH 'detect fudged signature' ' git hash-object -w -t commit forged1 >forged1.commit && test_must_fail git verify-commit $(cat forged1.commit) && git show --pretty=short --show-signature $(cat forged1.commit) >actual1 &&- grep "${GPGSSH_BAD_SIGNATURE}" actual1 &&- ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual1 &&- ! grep "${GPGSSH_GOOD_SIGNATURE_UNTRUSTED}" actual1+ test_grep "${GPGSSH_BAD_SIGNATURE}" actual1 &&+ test_grep ! "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual1 &&+ test_grep ! "${GPGSSH_GOOD_SIGNATURE_UNTRUSTED}" actual1 ' test_expect_success GPGSSH 'detect fudged signature with NUL' '@@ -281,8 +281,8 @@ test_expect_success GPGSSH 'detect fudged signature with NUL' ' git hash-object --literally -w -t commit forged2 >forged2.commit && test_must_fail git verify-commit $(cat forged2.commit) && git show --pretty=short --show-signature $(cat forged2.commit) >actual2 &&- grep "${GPGSSH_BAD_SIGNATURE}" actual2 &&- ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual2+ test_grep "${GPGSSH_BAD_SIGNATURE}" actual2 &&+ test_grep ! "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual2 ' test_expect_success GPGSSH 'amending already signed commit' '@@ -293,8 +293,8 @@ test_expect_success GPGSSH 'amending already signed commit' ' git commit --amend -S --no-edit && git verify-commit HEAD && git show -s --show-signature HEAD >actual &&- grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&- ! grep "${GPGSSH_BAD_SIGNATURE}" actual+ test_grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&+ test_grep ! "${GPGSSH_BAD_SIGNATURE}" actual ' test_expect_success GPGSSH 'show good signature with custom format' '@@ -386,7 +386,7 @@ test_expect_success GPGSSH 'log.showsignature behaves like --show-signature' ' test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" && test_config log.showsignature true && git show initial >actual &&- grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual+ test_grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual ' test_expect_success GPGSSH 'check config gpg.format values' '@@ -410,8 +410,8 @@ test_expect_failure GPGSSH 'detect fudged commit with double signature (TODO)' ' git hash-object -w -t commit double-commit >double-commit.commit && test_must_fail git verify-commit $(cat double-commit.commit) && git show --pretty=short --show-signature $(cat double-commit.commit) >double-actual &&- grep "BAD signature from" double-actual &&- grep "Good signature from" double-actual+ test_grep "BAD signature from" double-actual &&+ test_grep "Good signature from" double-actual ' test_expect_failure GPGSSH 'show double signature with custom format (TODO)' '@@ -463,8 +463,8 @@ test_expect_failure GPGSSH 'verify-commit verifies multiply signed commits (TODO head=$(git hash-object -t commit -w commit) && git reset --hard $head && git verify-commit $head 2>actual &&- grep "Good signature from" actual &&- ! grep "BAD signature from" actual+ test_grep "Good signature from" actual &&+ test_grep ! "BAD signature from" actual ' test_done
t/t7600-merge.sh
+5-5
index f877d9a433..a9c3c3920d 100755--- a/t/t7600-merge.sh+++ b/t/t7600-merge.sh@@ -342,8 +342,8 @@ test_expect_success 'merge --squash --autostash conflict does not attempt to app >unrelated && git add unrelated && test_must_fail git merge --squash c7 --autostash >out 2>err &&- ! grep "Applying autostash resulted in conflicts." err &&- grep "When finished, apply stashed changes with \`git stash pop\`" out+ test_grep ! "Applying autostash resulted in conflicts." err &&+ test_grep "When finished, apply stashed changes with \`git stash pop\`" out ' test_expect_success 'merge c3 with c7 with commit.cleanup = scissors' '@@ -990,7 +990,7 @@ test_expect_success 'merge --no-ff --edit' ' EDITOR=./editor git merge --no-ff --edit c1 && verify_parents $c0 $c1 && git cat-file commit HEAD >raw &&- grep "work done on the side branch" raw &&+ test_grep "work done on the side branch" raw && sed "1,/^$/d" >actual raw && test_cmp expected actual '@@ -1157,13 +1157,13 @@ test_expect_success 'merge suggests matching remote refname' ' git pack-refs --all --prune && test_must_fail git merge not-local 2>stderr &&- grep origin/not-local stderr+ test_grep origin/not-local stderr ' test_expect_success 'suggested names are not ambiguous' ' git update-ref refs/heads/origin/not-local HEAD && test_must_fail git merge not-local 2>stderr &&- grep remotes/origin/not-local stderr+ test_grep remotes/origin/not-local stderr ' test_done
t/t7603-merge-reduce-heads.sh
+10-10
index 1f8c3b7ccb..92007dc501 100755--- a/t/t7603-merge-reduce-heads.sh+++ b/t/t7603-merge-reduce-heads.sh@@ -59,11 +59,11 @@ test_expect_success 'merge c1 with c2, c3, c4, c5' ' test_path_is_file c4.c && test_path_is_file c5.c && git show --format=%s -s >actual &&- ! grep c1 actual &&- grep c2 actual &&- grep c3 actual &&- ! grep c4 actual &&- grep c5 actual+ test_grep ! c1 actual &&+ test_grep c2 actual &&+ test_grep c3 actual &&+ test_grep ! c4 actual &&+ test_grep c5 actual ' test_expect_success 'pull c2, c3, c4, c5 into c1' '@@ -82,11 +82,11 @@ test_expect_success 'pull c2, c3, c4, c5 into c1' ' test_path_is_file c4.c && test_path_is_file c5.c && git show --format=%s -s >actual &&- ! grep c1 actual &&- grep c2 actual &&- grep c3 actual &&- ! grep c4 actual &&- grep c5 actual+ test_grep ! c1 actual &&+ test_grep c2 actual &&+ test_grep c3 actual &&+ test_grep ! c4 actual &&+ test_grep c5 actual ' test_expect_success 'setup' '
t/t7606-merge-custom.sh
+1-1
index 81fb7c474c..0ae2f59b1d 100755--- a/t/t7606-merge-custom.sh+++ b/t/t7606-merge-custom.sh@@ -60,7 +60,7 @@ test_expect_success 'merge c2 with a custom strategy' ' test_cmp second-parent.expected second-parent && test_cmp tree.expected tree && test -f c0.c &&- grep c1c1 c1.c &&+ test_grep c1c1 c1.c && test -f c2.c '
t/t7607-merge-state.sh
+2-2
index 89a62ac53b..bfe782d89e 100755--- a/t/t7607-merge-state.sh+++ b/t/t7607-merge-state.sh@@ -20,8 +20,8 @@ test_expect_success 'Ensure we restore original state if no merge strategy handl # just hit conflicts, it completely fails and says that it cannot # handle this type of merge. test_expect_code 2 git merge branch2 branch3 >output 2>&1 &&- grep "fatal: merge program failed" output &&- grep "Should not be doing an octopus" output &&+ test_grep "fatal: merge program failed" output &&+ test_grep "Should not be doing an octopus" output && # Make sure we did not leave stray changes around when no appropriate # merge strategy was found
t/t7610-mergetool.sh
+9-9
index 957f8e20ba..0128b14452 100755--- a/t/t7610-mergetool.sh+++ b/t/t7610-mergetool.sh@@ -738,7 +738,7 @@ test_expect_success 'filenames seen by tools start with ./' ' test_config mergetool.myecho.trustExitCode true && test_must_fail git merge main && git mergetool --no-prompt --tool myecho -- both >actual &&- grep ^\./both_LOCAL_ actual+ test_grep ^\./both_LOCAL_ actual ' test_lazy_prereq MKTEMP '@@ -755,8 +755,8 @@ test_expect_success MKTEMP 'temporary filenames are used with mergetool.writeToT test_config mergetool.myecho.trustExitCode true && test_must_fail git merge main && git mergetool --no-prompt --tool myecho -- both >actual &&- ! grep ^\./both_LOCAL_ actual &&- grep /both_LOCAL_ actual+ test_grep ! ^\./both_LOCAL_ actual &&+ test_grep /both_LOCAL_ actual ' test_expect_success 'diff.orderFile configuration is honored' '@@ -816,12 +816,12 @@ test_expect_success 'mergetool -Oorder-file is honored' ' test_expect_success 'mergetool --tool-help shows recognized tools' ' # Check a few known tools are correctly shown git mergetool --tool-help >mergetools &&- grep vimdiff mergetools &&- grep vimdiff3 mergetools &&- grep gvimdiff2 mergetools &&- grep araxis mergetools &&- grep xxdiff mergetools &&- grep meld mergetools+ test_grep vimdiff mergetools &&+ test_grep vimdiff3 mergetools &&+ test_grep gvimdiff2 mergetools &&+ test_grep araxis mergetools &&+ test_grep xxdiff mergetools &&+ test_grep meld mergetools ' test_expect_success 'mergetool hideResolved' '
t/t7700-repack.sh
+7-7
index c6ff3aed30..f0a390e3c6 100755--- a/t/t7700-repack.sh+++ b/t/t7700-repack.sh@@ -177,7 +177,7 @@ test_expect_success 'packed unreachable obs in alternate ODB are not loosened' ' rm -f .git/objects/pack/* && mv pack-* .git/objects/pack/ && git verify-pack -v -- .git/objects/pack/*.idx >packlist &&- ! grep "^$coid " packlist &&+ test_grep ! "^$coid " packlist && echo >.git/objects/info/alternates && test_must_fail git show $coid '@@ -194,7 +194,7 @@ test_expect_success 'local packed unreachable obs that exist in alternate ODB ar rm -f .git/objects/pack/* && mv pack-* .git/objects/pack/ && git verify-pack -v -- .git/objects/pack/*.idx >packlist &&- ! grep "^$coid " packlist &&+ test_grep ! "^$coid " packlist && echo >.git/objects/info/alternates && test_must_fail git show $coid '@@ -226,8 +226,8 @@ test_expect_success 'repack --keep-pack' ' test_line_count = 4 old-counts && git repack -a -d --keep-pack $P1 --keep-pack $P4 && ls .git/objects/pack/*.pack >new-counts &&- grep -q $P1 new-counts &&- grep -q $P4 new-counts &&+ test_grep -q $P1 new-counts &&+ test_grep -q $P4 new-counts && test_line_count = 3 new-counts && git fsck &&@@ -276,7 +276,7 @@ test_expect_success 'repacking fails when missing .pack actually means missing o test_must_fail git fsck && test_must_fail env GIT_COMMIT_GRAPH_PARANOIA=true git repack --cruft -d 2>err &&- grep "bad object" err &&+ test_grep "bad object" err && # Before failing, the repack did not modify the # pack directory.@@ -460,8 +460,8 @@ test_expect_success '--filter works with --pack-kept-objects and .keep packs' ' # Object bar is in both the old .keep pack and the new # pack that contained the filtered out objects- grep "$bar_pack" bar_pack_1 &&- grep "$foo_pack_1" bar_pack_1 &&+ test_grep "$bar_pack" bar_pack_1 &&+ test_grep "$foo_pack_1" bar_pack_1 && test "$foo_pack_1" != "$head_pack_1" ) '
t/t7703-repack-geometric.sh
+2-2
index 04d5d8fc33..f3a0650cfe 100755--- a/t/t7703-repack-geometric.sh+++ b/t/t7703-repack-geometric.sh@@ -112,7 +112,7 @@ test_expect_success '--geometric with small-pack rollup' ' find $objdir/pack -name "*.pack" | sort >after && test_line_count = 3 after && comm -3 small before | tr -d "\t" >large &&- grep -qFf large after+ test_grep -qFf large after ) '@@ -210,7 +210,7 @@ test_expect_success '--geometric ignores --keep-pack packs' ' # Packs should not have changed (only one non-kept pack, no # loose objects), but $midx should now exist.- grep "Nothing new to pack" out &&+ test_grep "Nothing new to pack" out && test_path_is_file $midx && test_cmp packs.before packs.after &&
index 8da318d2b5..87b438fcac 100755--- a/t/t9003-help-autocorrect.sh+++ b/t/t9003-help-autocorrect.sh@@ -34,10 +34,10 @@ do git config help.autocorrect $show && test_must_fail git lfg 2>actual &&- grep "^ lgf" actual &&+ test_grep "^ lgf" actual && test_must_fail git distimdist 2>actual &&- grep "^ distimdistim" actual+ test_grep "^ distimdistim" actual ' done@@ -60,7 +60,7 @@ test_expect_success 'autocorrect can be declined altogether' ' git config help.autocorrect never && test_must_fail git lfg 2>actual &&- grep "is not a git command" actual &&+ test_grep "is not a git command" actual && test_line_count = 1 actual '
t/t9106-git-svn-commit-diff-clobber.sh
+1-1
index bca496c40e..376100fd7a 100755--- a/t/t9106-git-svn-commit-diff-clobber.sh+++ b/t/t9106-git-svn-commit-diff-clobber.sh@@ -94,7 +94,7 @@ test_expect_success 'multiple dcommit from git svn will not clobber svn' " test_expect_success 'check that rebase really failed' ' git status >output &&- grep currently.rebasing output+ test_grep currently.rebasing output ' test_expect_success 'resolve, continue the rebase and dcommit' "
index 0fc289ae0f..21401ad2b1 100755--- a/t/t9122-git-svn-author.sh+++ b/t/t9122-git-svn-author.sh@@ -57,15 +57,15 @@ test_expect_success 'interact with it via git svn' ' test "z$myself" = "z$unaffected" && # Make sure lack of --add-author-from did not add cruft- ! grep "^ From: A U Thor " actual.2 &&+ test_grep ! "^ From: A U Thor " actual.2 && # Make sure --add-author-from added cruft- grep "^ From: A U Thor " actual.3 &&- grep "^ From: A U Thor " actual.4 &&+ test_grep "^ From: A U Thor " actual.3 &&+ test_grep "^ From: A U Thor " actual.4 && # Make sure --add-author-from with --use-log-author affected # the authorship information- grep "^Author: A U Thor " actual.4 &&+ test_grep "^Author: A U Thor " actual.4 && # Make sure there are no commit messages with excess blank lines test $(grep "^ " actual.2 | wc -l) = 3 &&