Git development
 help / color / mirror / Atom feed
* [PATCH] Fix guilt to work correctly even if the refs are packed
@ 2007-07-06 14:57 Theodore Ts'o
  2007-07-06 15:12 ` Josef Sipek
  0 siblings, 1 reply; 2+ messages in thread
From: Theodore Ts'o @ 2007-07-06 14:57 UTC (permalink / raw)
  To: Josef 'Jeff' Sipek; +Cc: git


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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-06 15:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-06 14:57 [PATCH] Fix guilt to work correctly even if the refs are packed Theodore Ts'o
2007-07-06 15:12 ` Josef Sipek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox