summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Michael Haggerty <mhagger@alum.mit.edu>2013-04-22 21:52:16 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-05-01 15:33:09 -0700
commitf361baeb71fbe9e6fe02f53243673e194265c4cc (patch)
treecb2853a95bc865d37a470936dae3d6c5af1da9f6
parentget_packed_ref(): return a ref_entry (diff)
downloadtgif-f361baeb71fbe9e6fe02f53243673e194265c4cc.tar.xz
peel_ref(): use function get_packed_ref()
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--refs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/refs.c b/refs.c
index fbcc044eec..d2458275a9 100644
--- a/refs.c
+++ b/refs.c
@@ -1283,10 +1283,9 @@ int peel_ref(const char *refname, unsigned char *sha1)
return -1;
if ((flag & REF_ISPACKED)) {
- struct ref_dir *dir = get_packed_refs(get_ref_cache(NULL));
- struct ref_entry *r = find_ref(dir, refname);
+ struct ref_entry *r = get_packed_ref(refname);
- if (r != NULL && r->flag & REF_KNOWS_PEELED) {
+ if (r && (r->flag & REF_KNOWS_PEELED)) {
hashcpy(sha1, r->u.value.peeled);
return 0;
}