git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t/t1467-refs-rename: Use test_must_fail in place of NOT operator

From
Hardik Kumar <hardikxk@gmail.com>
Date
Oct 27, 2026, 18:48 UTC
Message-ID
<20261028-refs-rename-test-fail-v1-1-b7458ca62149@gmail.com>

All tests in `t/t1467-refs-rename.sh` use test_must_fail for verifying when a test or command is expected to fail. `test_must_fail` is used for all Git commands.

The use of the NOT operator is replaced with `test_must_fail` to ensure consistency in the unit tests without any functional changes to the tests themselves.

Signed-off-by: Hardik Kumar <hardikxk@gmail.com>
---
 t/t1467-refs-rename.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t1467-refs-rename.sh b/t/t1467-refs-rename.sh
index 2b28be75c8..b7d290d05b 100755
--- a/t/t1467-refs-rename.sh
+++ b/t/t1467-refs-rename.sh
@@ -88,7 +88,7 @@ test_expect_success 'rename with symbolic ref fails' '
 		A=$(git rev-parse A) &&
 		git refs create refs/heads/target $A &&
 		git symbolic-ref refs/heads/symref refs/heads/target &&
-		! git refs rename refs/heads/symref refs/heads/renamed 2>err &&
+		test_must_fail git refs rename refs/heads/symref refs/heads/renamed 2>err &&
 		test_grep "is a symbolic ref, .* not supported" err
 	)
 '

---
base-commit: 37b3475fb530c14109211faca33716a173db61ed
change-id: 20261028-refs-rename-test-fail-ec7a8fa74e54
Next: Junio C Hamano
Message 1 of 3 in “t/t1467-refs-rename: Use test_must_fail in place of NOT operator”
  1. t/t1467-refs-rename: Use test_must_fail in place of NOT operatorHardik Kumar, Oct 27, 2026
  2. Junio C HamanoOct 28, 2026
  3. Hardik KumarOct 28, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.