aboutsummaryrefslogtreecommitdiff
path: root/refs/files-backend.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2017-06-23 09:01:42 +0200
committerJunio C Hamano <gitster@pobox.com>2017-06-23 13:27:33 -0700
commitc8bed835c2a37056aa8f61769c6d8cc7f57bc4d3 (patch)
tree9ec114009b6eb784ff0f3ce89aa54268f7c1eeea /refs/files-backend.c
parentb7de57d8d18a08ab517b4d01151129f521185271 (diff)
downloadgit-c8bed835c2a37056aa8f61769c6d8cc7f57bc4d3.tar.gz
git-c8bed835c2a37056aa8f61769c6d8cc7f57bc4d3.tar.xz
packed_refs_lock(): report errors via a `struct strbuf *err`
That way the callers don't have to come up with error messages themselves. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/files-backend.c')
-rw-r--r--refs/files-backend.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 88de90714..8ea4e9ab0 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1096,7 +1096,7 @@ static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
struct ref_to_prune *refs_to_prune = NULL;
struct strbuf err = STRBUF_INIT;
- packed_refs_lock(refs->packed_ref_store, LOCK_DIE_ON_ERROR);
+ packed_refs_lock(refs->packed_ref_store, LOCK_DIE_ON_ERROR, &err);
iter = cache_ref_iterator_begin(get_loose_ref_cache(refs), NULL, 0);
while ((ok = ref_iterator_advance(iter)) == ITER_OK) {
@@ -2679,9 +2679,7 @@ static int files_initial_transaction_commit(struct ref_store *ref_store,
}
}
- if (packed_refs_lock(refs->packed_ref_store, 0)) {
- strbuf_addf(err, "unable to lock packed-refs file: %s",
- strerror(errno));
+ if (packed_refs_lock(refs->packed_ref_store, 0, err)) {
ret = TRANSACTION_GENERIC_ERROR;
goto cleanup;
}