From: "Michael Montalbo via GitGitGadget" <gitgitgadget@gmail•com>
To: git@vger•kernel.org
Cc: "D. Ben Knoble" <ben.knoble@gmail•com>,
Eric Sunshine <sunshine@sunshineco•com>,
Michael Montalbo <mmontalbo@gmail•com>,
Michael Montalbo <mmontalbo@gmail•com>
Subject: [PATCH 5/6] t: fix grep assertions missing file arguments
Date: Thu, 04 Jun 2026 07:45:57 +0000 [thread overview]
Message-ID: <c0db9fdb5bf9a9b8218e32de043b8a9ca1aaf023.1780559158.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.2135.git.1780559158.gitgitgadget@gmail.com>
From: Michael Montalbo <mmontalbo@gmail•com>
Three grep assertions were missing their file arguments, causing
them to read from empty stdin instead of the intended file:
- t2402: '! grep ...' should read from 'out', matching the
grep on the preceding line.
- t7507: the closing quote is in the wrong place, making the
entire 'diff --git actual' a single pattern with no file
argument instead of pattern 'diff --git' and file 'actual'.
- t7700: '! grep ...' should read from 'packlist', matching
the redirect on the preceding line.
Without file arguments these greps always succeed (empty stdin
matches nothing), so the assertions were not actually checking
anything. All three tests pass with the corrected file arguments,
confirming the intended behavior is sound.
Signed-off-by: Michael Montalbo <mmontalbo@gmail•com>
---
t/t2402-worktree-list.sh | 2 +-
t/t7507-commit-verbose.sh | 2 +-
t/t7700-repack.sh | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t2402-worktree-list.sh b/t/t2402-worktree-list.sh
index e0c6abd2f5..93f92e854a 100755
--- a/t/t2402-worktree-list.sh
+++ b/t/t2402-worktree-list.sh
@@ -144,7 +144,7 @@ test_expect_success '"list" all worktrees with prunable annotation' '
rm -rf prunable &&
git worktree list >out &&
grep "/prunable *[0-9a-f].* prunable$" out &&
- ! grep "/unprunable *[0-9a-f].* prunable$"
+ ! grep "/unprunable *[0-9a-f].* prunable$" out
'
test_expect_success '"list" all worktrees --porcelain with prunable' '
diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh
index b53d71c086..acdb6b1455 100755
--- a/t/t7507-commit-verbose.sh
+++ b/t/t7507-commit-verbose.sh
@@ -163,7 +163,7 @@ done
test_expect_success "status ignores commit.verbose=true" '
git -c commit.verbose=true status >actual &&
- ! grep "^diff --git actual"
+ ! grep "^diff --git" actual
'
test_done
diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh
index 63ef63fc50..c6ff3aed30 100755
--- a/t/t7700-repack.sh
+++ b/t/t7700-repack.sh
@@ -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 " &&
+ ! grep "^$coid " packlist &&
echo >.git/objects/info/alternates &&
test_must_fail git show $coid
'
--
gitgitgadget
next prev parent reply other threads:[~2026-06-04 7:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 7:45 [PATCH 0/6] t: add lint-style.pl and convert grep to test_grep Michael Montalbo via GitGitGadget
2026-06-04 7:45 ` [PATCH 1/6] t/README: document test_grep helper Michael Montalbo via GitGitGadget
2026-06-04 7:45 ` [PATCH 2/6] t: extract chainlint's parser into shared module Michael Montalbo via GitGitGadget
2026-06-04 7:45 ` [PATCH 3/6] t: fix Lexer line count for $() inside double-quoted strings Michael Montalbo via GitGitGadget
2026-06-04 7:45 ` [PATCH 4/6] t: add lint-style.pl with test_grep negation rule Michael Montalbo via GitGitGadget
2026-06-04 18:34 ` D. Ben Knoble
2026-06-04 19:36 ` Michael Montalbo
2026-06-04 7:45 ` Michael Montalbo via GitGitGadget [this message]
2026-06-04 7:45 ` [PATCH 6/6] t: lint and convert grep assertions to test_grep Michael Montalbo via GitGitGadget
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c0db9fdb5bf9a9b8218e32de043b8a9ca1aaf023.1780559158.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail$(echo .)com \
--cc=ben.knoble@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=mmontalbo@gmail$(echo .)com \
--cc=sunshine@sunshineco$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox