Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
commit_packed_refs(): take a `packed_ref_store *` parameter
author
Michael Haggerty
<mhagger@alum.mit.edu>
Fri, 23 Jun 2017 07:01:30 +0000
(09:01 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 23 Jun 2017 20:27:32 +0000
(13:27 -0700)
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>
refs/files-backend.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
f512f0f
)
diff --git
a/refs/files-backend.c
b/refs/files-backend.c
index 0d8f39089f04e8b9abcb619a5a83cc09fadb14dd..5d159620f07e364059ade25ed6bb68798c6c54d9 100644
(file)
--- a/
refs/files-backend.c
+++ b/
refs/files-backend.c
@@
-1388,21
+1388,21
@@
static int lock_packed_refs(struct packed_ref_store *refs, int flags)
* lock_packed_refs()). Return zero on success. On errors, set errno
* and return a nonzero value
*/
* lock_packed_refs()). Return zero on success. On errors, set errno
* and return a nonzero value
*/
-static int commit_packed_refs(struct
files
_ref_store *refs)
+static int commit_packed_refs(struct
packed
_ref_store *refs)
{
struct packed_ref_cache *packed_ref_cache =
{
struct packed_ref_cache *packed_ref_cache =
- get_packed_ref_cache(refs
->packed_ref_store
);
+ get_packed_ref_cache(refs);
int ok, error = 0;
int save_errno = 0;
FILE *out;
struct ref_iterator *iter;
int ok, error = 0;
int save_errno = 0;
FILE *out;
struct ref_iterator *iter;
-
files
_assert_main_repository(refs, "commit_packed_refs");
+
packed
_assert_main_repository(refs, "commit_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");
die("BUG: packed-refs not locked");
- out = fdopen_lock_file(&refs->
packed_ref_store->
lock, "w");
+ out = fdopen_lock_file(&refs->lock, "w");
if (!out)
die_errno("unable to fdopen packed-refs descriptor");
if (!out)
die_errno("unable to fdopen packed-refs descriptor");
@@
-1420,7
+1420,7
@@
static int commit_packed_refs(struct files_ref_store *refs)
if (ok != ITER_DONE)
die("error while iterating over references");
if (ok != ITER_DONE)
die("error while iterating over references");
- if (commit_lock_file(&refs->
packed_ref_store->
lock)) {
+ if (commit_lock_file(&refs->lock)) {
save_errno = errno;
error = -1;
}
save_errno = errno;
error = -1;
}
@@
-1606,7
+1606,7
@@
static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
if (ok != ITER_DONE)
die("error while iterating over references");
if (ok != ITER_DONE)
die("error while iterating over references");
- if (commit_packed_refs(refs))
+ if (commit_packed_refs(refs
->packed_ref_store
))
die_errno("unable to overwrite old ref-pack file");
prune_refs(refs, refs_to_prune);
die_errno("unable to overwrite old ref-pack file");
prune_refs(refs, refs_to_prune);
@@
-1662,7
+1662,7
@@
static int repack_without_refs(struct files_ref_store *refs,
}
/* Write what remains */
}
/* Write what remains */
- ret = commit_packed_refs(refs);
+ ret = commit_packed_refs(refs
->packed_ref_store
);
if (ret)
strbuf_addf(err, "unable to overwrite old ref-pack file: %s",
strerror(errno));
if (ret)
strbuf_addf(err, "unable to overwrite old ref-pack file: %s",
strerror(errno));
@@
-3227,7
+3227,7
@@
static int files_initial_transaction_commit(struct ref_store *ref_store,
&update->new_oid);
}
&update->new_oid);
}
- if (commit_packed_refs(refs)) {
+ if (commit_packed_refs(refs
->packed_ref_store
)) {
strbuf_addf(err, "unable to commit packed-refs file: %s",
strerror(errno));
ret = TRANSACTION_GENERIC_ERROR;
strbuf_addf(err, "unable to commit packed-refs file: %s",
strerror(errno));
ret = TRANSACTION_GENERIC_ERROR;