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>
Michael Haggerty committed
Apr 22, 2013 at 21:52 UTC
7618fd808aab2b7232abea04f1e7d8aa0ca2a476
1 file changed
+5
-3
refs.c
+5
-3
@@ -1821,9 +1821,11 @@ static int repack_without_ref(const char *refname)
1821
{
1822
struct repack_without_ref_sb data;
1823
struct ref_cache *refs = get_ref_cache(NULL);
1824
- struct ref_dir *packed = get_packed_refs(refs);
1825
- if (find_ref(packed, refname) == NULL)
1826
- return 0;
1824
+ struct ref_dir *packed;
1825
+
1826
+ if (!get_packed_ref(refname))
1827
+ return 0; /* refname does not exist in packed refs */
1828
+
1829
data.refname = refname;
1830
data.fd = hold_lock_file_for_update(&packlock, git_path("packed-refs"), 0);
1831
if (data.fd < 0) {