diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2017-06-23 10:01:31 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-23 23:27:32 +0300 |
commit | 38e3fe6decfb7c32eb08a58b192c428c18180508 (patch) | |
tree | 25dfa8d4fc9a9bd1c2913848d8c76f5fe471fb16 /refs | |
parent | cf30b3e88b0551f67ff4e0b8c35aedf6b03c41d7 (diff) |
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>
Diffstat (limited to 'refs')
-rw-r--r-- | refs/files-backend.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c index 5d159620f0..a08d3fbadf 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -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; } |