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

[PATCH] Fix guilt to work correctly even if the refs are packed

From
Theodore Ts'o <tytso@mit.edu>
Date
Jul 6, 2007, 14:57 UTC
Message-ID
<E1I6pF5-0003V9-2R@candygram.thunk.org>

Explicitly referencing .git/refs/heads/$branch is bad; use git show-ref -h instead.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 guilt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/guilt b/guilt
index 814f755..54f9087 100755
--- a/guilt
+++ b/guilt
@@ -247,7 +247,7 @@ head_check()
 	# if the expected hash is empty, just return
 	[ -z "$1" ] && return 0
 
-	if [ "`cat "$GIT_DIR/refs/heads/$branch"`" != "$1" ]; then
+	if [ "`git show-ref -s "refs/heads/$branch"`" != "$1" ]; then
 		echo "Expected HEAD commit $1" >&2
 		echo "                 got `cat "$GIT_DIR/refs/heads/$branch"`" >&2
 		return 1
-- 
1.5.3.rc0.11.ge2b1a
Next: Josef Sipek
Message 1 of 2 in “Fix guilt to work correctly even if the refs are packed”
  1. Fix guilt to work correctly even if the refs are packedTheodore Ts'o, Jul 6, 2007
  2. Josef SipekJul 6, 2007

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.