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

[PATCH] t1402: check to delete broken refs

From
Stefan Beller <sbeller@google.com>
Date
Nov 25, 2014, 22:56 UTC
Message-ID
<1416956166-20341-1-git-send-email-sbeller@google.com>
From: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
---
 
 This was also part of the ongoing series from Ronnie.
 But I think the patch in this form is rather independant, 
 documenting the current state of "git branch -d", so it's 
 fine to have it in now.
 t/t1402-check-ref-format.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh
index e5dc62e..08af156 100755
--- a/t/t1402-check-ref-format.sh
+++ b/t/t1402-check-ref-format.sh
@@ -197,4 +197,12 @@ invalid_ref_normalized 'heads///foo.lock'
 invalid_ref_normalized 'foo.lock/bar'
 invalid_ref_normalized 'foo.lock///bar'
 
+test_expect_failure 'git branch -d can delete ref with broken sha1' '
+	echo "pointing nowhere" > .git/refs/heads/brokensha1 &&
+	test_when_finished "rm -f .git/refs/heads/brokensha1" &&
+	git branch -d brokensha1 &&
+	git branch >output &&
+	! grep -e "brokensha1" output
+'
+
 test_done
-- 
2.2.0.rc3
Next: Jonathan Nieder
Message 1 of 8 in “t1402: check to delete broken refs”
  1. t1402: check to delete broken refsStefan Beller, Nov 25, 2014
  2. Jonathan NiederNov 26, 2014
  3. Stefan BellerNov 26, 2014
  4. [PATCHv2] branch -d: test if we can delete broken refsStefan Beller, Nov 26, 2014
  5. Michael HaggertyNov 26, 2014
  6. Junio C HamanoNov 26, 2014
  7. Torsten BögershausenNov 26, 2014
  8. [PATCHv3] branch -d: test if we can delete broken refsStefan Beller, Nov 26, 2014

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.