t: fix grep assertions missing file arguments

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> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael Montalbo committed Jul 6, 2026 at 05:01 UTC 04e875a364f5a3792077a3e90c6f546b4cf7ea4c
3 files changed +3 -3
t/t2402-worktree-list.sh
+1 -1
@@ -144,7 +144,7 @@ test_expect_success '"list" all worktrees with prunable annotation' '
144 rm -rf prunable &&
145 git worktree list >out &&
146 grep "/prunable *[0-9a-f].* prunable$" out &&
147 - ! grep "/unprunable *[0-9a-f].* prunable$"
147 + ! grep "/unprunable *[0-9a-f].* prunable$" out
148 '
149
150 test_expect_success '"list" all worktrees --porcelain with prunable' '
t/t7507-commit-verbose.sh
+1 -1
@@ -163,7 +163,7 @@ done
163
164 test_expect_success "status ignores commit.verbose=true" '
165 git -c commit.verbose=true status >actual &&
166 - ! grep "^diff --git actual"
166 + ! grep "^diff --git" actual
167 '
168
169 test_done
t/t7700-repack.sh
+1 -1
@@ -194,7 +194,7 @@ test_expect_success 'local packed unreachable obs that exist in alternate ODB ar
194 rm -f .git/objects/pack/* &&
195 mv pack-* .git/objects/pack/ &&
196 git verify-pack -v -- .git/objects/pack/*.idx >packlist &&
197 - ! grep "^$coid " &&
197 + ! grep "^$coid " packlist &&
198 echo >.git/objects/info/alternates &&
199 test_must_fail git show $coid
200 '