From: Michael Haggerty Date: Mon, 22 Apr 2013 19:52:17 +0000 (+0200) Subject: repack_without_ref(): use function get_packed_ref() X-Git-Tag: v1.8.4-rc0~251^2~24 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7618fd808aab2b7232abea04f1e7d8aa0ca2a476;p=git-core%2Fgit.git repack_without_ref(): use function get_packed_ref() Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- diff --git a/refs.c b/refs.c index d2458275a..03c19be2c 100644 --- a/refs.c +++ b/refs.c @@ -1821,9 +1821,11 @@ static int repack_without_ref(const char *refname) { struct repack_without_ref_sb data; struct ref_cache *refs = get_ref_cache(NULL); - struct ref_dir *packed = get_packed_refs(refs); - if (find_ref(packed, refname) == NULL) - return 0; + struct ref_dir *packed; + + if (!get_packed_ref(refname)) + return 0; /* refname does not exist in packed refs */ + data.refname = refname; data.fd = hold_lock_file_for_update(&packlock, git_path("packed-refs"), 0); if (data.fd < 0) {