It only cares about the packed-refs part of the reference store.
Signed-off-by: Michael Haggerty <[email protected]>
---
refs/files-backend.c | 15 +++++++--------
1 file 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;
}
--
2.11.0