rollback_packed_refs(): take a `packed_ref_store *` parameter
authorMichael Haggerty <mhagger@alum.mit.edu>
Fri, 23 Jun 2017 07:01:31 +0000 (09:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 23 Jun 2017 20:27:32 +0000 (13:27 -0700)
It only cares about the packed-refs part of the reference store.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c
index 5d159620f07e364059ade25ed6bb68798c6c54d9..a08d3fbadff948f02fe6046ee8a333ef5ae59daf 100644 (file)
@@ -1434,18 +1434,17 @@ static int commit_packed_refs(struct packed_ref_store *refs)
  * in-memory packed reference cache.  (The packed-refs file will be
  * read anew if it is needed again after this function is called.)
  */
-static void rollback_packed_refs(struct files_ref_store *refs)
+static void rollback_packed_refs(struct packed_ref_store *refs)
 {
-       struct packed_ref_cache *packed_ref_cache =
-               get_packed_ref_cache(refs->packed_ref_store);
+       struct packed_ref_cache *packed_ref_cache = get_packed_ref_cache(refs);
 
-       files_assert_main_repository(refs, "rollback_packed_refs");
+       packed_assert_main_repository(refs, "rollback_packed_refs");
 
-       if (!is_lock_file_locked(&refs->packed_ref_store->lock))
+       if (!is_lock_file_locked(&refs->lock))
                die("BUG: packed-refs not locked");
-       rollback_lock_file(&refs->packed_ref_store->lock);
+       rollback_lock_file(&refs->lock);
        release_packed_ref_cache(packed_ref_cache);
-       clear_packed_ref_cache(refs->packed_ref_store);
+       clear_packed_ref_cache(refs);
 }
 
 struct ref_to_prune {
@@ -1657,7 +1656,7 @@ static int repack_without_refs(struct files_ref_store *refs,
                 * All packed entries disappeared while we were
                 * acquiring the lock.
                 */
-               rollback_packed_refs(refs);
+               rollback_packed_refs(refs->packed_ref_store);
                return 0;
        }