Skip to contentSkip to conversation

Fix guilt to work correctly even if the refs are packed

PATCH Applied Theodore Ts'o 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix guilt to work correctly even if the refs are packed

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

---
 guilt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
guilt +1 -1
index 814f755..54f9087 100755
@@ -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
Signature · 1 line
1.5.3.rc0.11.ge2b1a
Applied
#1 lore raw
Quoted 3 lines · Theodore Ts'o

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

Applied, I fixed up the commit message; you say -h but the code used -s.

Thanks.

Josef "Jeff" Sipek.

Signature · 2 lines
If I have trouble installing Linux, something is wrong. Very wrong.
		- Linus Torvalds