summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2013-04-22 21:52:17 +0200
committerJunio C Hamano <gitster@pobox.com>2013-05-01 15:33:09 -0700
commit7618fd808aab2b7232abea04f1e7d8aa0ca2a476 (patch)
tree09bc1ebd635b87fec7d0deff121caf291e7b7490 /refs.c
parentf361baeb71fbe9e6fe02f53243673e194265c4cc (diff)
downloadgit-7618fd808aab2b7232abea04f1e7d8aa0ca2a476.tar.gz
repack_without_ref(): use function get_packed_ref()
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/refs.c b/refs.c
index d2458275a9..03c19be2c1 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) {