rollback_packed_refs(): take a `packed_ref_store *` parameter

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>

Michael Haggerty committed Jun 23, 2017 at 09:01 UTC 38e3fe6decfb7c32eb08a58b192c428c18180508
1 file changed +7 -8
refs/files-backend.c
+7 -8
@@ -1434,18 +1434,17 @@ static int commit_packed_refs(struct packed_ref_store *refs)
1434 * in-memory packed reference cache. (The packed-refs file will be
1435 * read anew if it is needed again after this function is called.)
1436 */
1437 -static void rollback_packed_refs(struct files_ref_store *refs)
1437 +static void rollback_packed_refs(struct packed_ref_store *refs)
1438 {
1439 - struct packed_ref_cache *packed_ref_cache =
1440 - get_packed_ref_cache(refs->packed_ref_store);
1439 + struct packed_ref_cache *packed_ref_cache = get_packed_ref_cache(refs);
1440
1442 - files_assert_main_repository(refs, "rollback_packed_refs");
1441 + packed_assert_main_repository(refs, "rollback_packed_refs");
1442
1444 - if (!is_lock_file_locked(&refs->packed_ref_store->lock))
1443 + if (!is_lock_file_locked(&refs->lock))
1444 die("BUG: packed-refs not locked");
1446 - rollback_lock_file(&refs->packed_ref_store->lock);
1445 + rollback_lock_file(&refs->lock);
1446 release_packed_ref_cache(packed_ref_cache);
1448 - clear_packed_ref_cache(refs->packed_ref_store);
1447 + clear_packed_ref_cache(refs);
1448 }
1449
1450 struct ref_to_prune {
@@ -1657,7 +1656,7 @@ static int repack_without_refs(struct files_ref_store *refs,
1656 * All packed entries disappeared while we were
1657 * acquiring the lock.
1658 */
1660 - rollback_packed_refs(refs);
1659 + rollback_packed_refs(refs->packed_ref_store);
1660 return 0;
1661 }
1662