Skip to content

Commit 38e3fe6

Browse files
mhaggergitster
authored andcommitted
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>
1 parent cf30b3e commit 38e3fe6

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

refs/files-backend.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,18 +1434,17 @@ static int commit_packed_refs(struct packed_ref_store *refs)
14341434
* in-memory packed reference cache. (The packed-refs file will be
14351435
* read anew if it is needed again after this function is called.)
14361436
*/
1437-
static void rollback_packed_refs(struct files_ref_store *refs)
1437+
static void rollback_packed_refs(struct packed_ref_store *refs)
14381438
{
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);
14411440

1442-
files_assert_main_repository(refs, "rollback_packed_refs");
1441+
packed_assert_main_repository(refs, "rollback_packed_refs");
14431442

1444-
if (!is_lock_file_locked(&refs->packed_ref_store->lock))
1443+
if (!is_lock_file_locked(&refs->lock))
14451444
die("BUG: packed-refs not locked");
1446-
rollback_lock_file(&refs->packed_ref_store->lock);
1445+
rollback_lock_file(&refs->lock);
14471446
release_packed_ref_cache(packed_ref_cache);
1448-
clear_packed_ref_cache(refs->packed_ref_store);
1447+
clear_packed_ref_cache(refs);
14491448
}
14501449

14511450
struct ref_to_prune {
@@ -1657,7 +1656,7 @@ static int repack_without_refs(struct files_ref_store *refs,
16571656
* All packed entries disappeared while we were
16581657
* acquiring the lock.
16591658
*/
1660-
rollback_packed_refs(refs);
1659+
rollback_packed_refs(refs->packed_ref_store);
16611660
return 0;
16621661
}
16631662

0 commit comments

Comments
 (0)