Skip to content

Commit cf30b3e

Browse files
mhaggergitster
authored andcommitted
commit_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 f512f0f commit cf30b3e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

refs/files-backend.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,21 +1388,21 @@ static int lock_packed_refs(struct packed_ref_store *refs, int flags)
13881388
* lock_packed_refs()). Return zero on success. On errors, set errno
13891389
* and return a nonzero value
13901390
*/
1391-
static int commit_packed_refs(struct files_ref_store *refs)
1391+
static int commit_packed_refs(struct packed_ref_store *refs)
13921392
{
13931393
struct packed_ref_cache *packed_ref_cache =
1394-
get_packed_ref_cache(refs->packed_ref_store);
1394+
get_packed_ref_cache(refs);
13951395
int ok, error = 0;
13961396
int save_errno = 0;
13971397
FILE *out;
13981398
struct ref_iterator *iter;
13991399

1400-
files_assert_main_repository(refs, "commit_packed_refs");
1400+
packed_assert_main_repository(refs, "commit_packed_refs");
14011401

1402-
if (!is_lock_file_locked(&refs->packed_ref_store->lock))
1402+
if (!is_lock_file_locked(&refs->lock))
14031403
die("BUG: packed-refs not locked");
14041404

1405-
out = fdopen_lock_file(&refs->packed_ref_store->lock, "w");
1405+
out = fdopen_lock_file(&refs->lock, "w");
14061406
if (!out)
14071407
die_errno("unable to fdopen packed-refs descriptor");
14081408

@@ -1420,7 +1420,7 @@ static int commit_packed_refs(struct files_ref_store *refs)
14201420
if (ok != ITER_DONE)
14211421
die("error while iterating over references");
14221422

1423-
if (commit_lock_file(&refs->packed_ref_store->lock)) {
1423+
if (commit_lock_file(&refs->lock)) {
14241424
save_errno = errno;
14251425
error = -1;
14261426
}
@@ -1606,7 +1606,7 @@ static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
16061606
if (ok != ITER_DONE)
16071607
die("error while iterating over references");
16081608

1609-
if (commit_packed_refs(refs))
1609+
if (commit_packed_refs(refs->packed_ref_store))
16101610
die_errno("unable to overwrite old ref-pack file");
16111611

16121612
prune_refs(refs, refs_to_prune);
@@ -1662,7 +1662,7 @@ static int repack_without_refs(struct files_ref_store *refs,
16621662
}
16631663

16641664
/* Write what remains */
1665-
ret = commit_packed_refs(refs);
1665+
ret = commit_packed_refs(refs->packed_ref_store);
16661666
if (ret)
16671667
strbuf_addf(err, "unable to overwrite old ref-pack file: %s",
16681668
strerror(errno));
@@ -3227,7 +3227,7 @@ static int files_initial_transaction_commit(struct ref_store *ref_store,
32273227
&update->new_oid);
32283228
}
32293229

3230-
if (commit_packed_refs(refs)) {
3230+
if (commit_packed_refs(refs->packed_ref_store)) {
32313231
strbuf_addf(err, "unable to commit packed-refs file: %s",
32323232
strerror(errno));
32333233
ret = TRANSACTION_GENERIC_ERROR;

0 commit comments

Comments
 (0)