refs API: make refs_read_raw_ref() not set errno
Add a "failure_errno" to refs_read_raw_ref(), his allows refs_werrres_ref_unsafe() to pass along its "failure_errno", as a first step before its own callers are migrated to pass it further up the chain. We are leaving out out the refs_read_special_head() in refs_read_raw_ref() for now, as noted in a subsequent commit moving it to "failure_errno" will require some special consideration. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
ef18119dec
commit
8b72fea7e9
@ -1347,6 +1347,7 @@ int is_packed_transaction_needed(struct ref_store *ref_store,
|
||||
ret = 0;
|
||||
for (i = 0; i < transaction->nr; i++) {
|
||||
struct ref_update *update = transaction->updates[i];
|
||||
int failure_errno;
|
||||
unsigned int type;
|
||||
struct object_id oid;
|
||||
|
||||
@ -1357,9 +1358,9 @@ int is_packed_transaction_needed(struct ref_store *ref_store,
|
||||
*/
|
||||
continue;
|
||||
|
||||
if (!refs_read_raw_ref(ref_store, update->refname,
|
||||
&oid, &referent, &type) ||
|
||||
errno != ENOENT) {
|
||||
if (!refs_read_raw_ref(ref_store, update->refname, &oid,
|
||||
&referent, &type, &failure_errno) ||
|
||||
failure_errno != ENOENT) {
|
||||
/*
|
||||
* We have to actually delete that reference
|
||||
* -> this transaction is needed.
|
||||
|
Reference in New Issue
Block a user