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

2 messages from 2007-07-06 to 2007-07-06. Participants: Theodore Ts'o, Josef Sipek.
Thread: https://gitlist.dev/t/8896

## Theodore Ts'o, 2007-07-06 14:57

Subject: [PATCH] Fix guilt to work correctly even if the refs are packed
Message-ID: <E1I6pF5-0003V9-2R@candygram.thunk.org>
URL: https://gitlist.dev/e/E1I6pF5-0003V9-2R%40candygram.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

```

## Josef Sipek, 2007-07-06 15:12

Subject: Re: [PATCH] Fix guilt to work correctly even if the refs are packed
Message-ID: <20070706151238.GA1607@filer.fsl.cs.sunysb.edu>
URL: https://gitlist.dev/e/20070706151238.GA1607%40filer.fsl.cs.sunysb.edu
In-Reply-To: <E1I6pF5-0003V9-2R@candygram.thunk.org>

```
On Fri, Jul 06, 2007 at 10:57:07AM -0400, Theodore Ts'o wrote:
> 
> 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.

-- 
If I have trouble installing Linux, something is wrong. Very wrong.
		- Linus Torvalds

```
