Merge branch 'hn/refs-trace-errno'
Show errno in the trace output in the error codepath that calls read_raw_ref method. * hn/refs-trace-errno: refs: print errno for read_raw_ref if GIT_TRACE_REFS is set
This commit is contained in:
@ -244,6 +244,7 @@ static int debug_read_raw_ref(struct ref_store *ref_store, const char *refname,
|
|||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
||||||
oidcpy(oid, &null_oid);
|
oidcpy(oid, &null_oid);
|
||||||
|
errno = 0;
|
||||||
res = drefs->refs->be->read_raw_ref(drefs->refs, refname, oid, referent,
|
res = drefs->refs->be->read_raw_ref(drefs->refs, refname, oid, referent,
|
||||||
type);
|
type);
|
||||||
|
|
||||||
@ -251,7 +252,9 @@ static int debug_read_raw_ref(struct ref_store *ref_store, const char *refname,
|
|||||||
trace_printf_key(&trace_refs, "read_raw_ref: %s: %s (=> %s) type %x: %d\n",
|
trace_printf_key(&trace_refs, "read_raw_ref: %s: %s (=> %s) type %x: %d\n",
|
||||||
refname, oid_to_hex(oid), referent->buf, *type, res);
|
refname, oid_to_hex(oid), referent->buf, *type, res);
|
||||||
} else {
|
} else {
|
||||||
trace_printf_key(&trace_refs, "read_raw_ref: %s: %d\n", refname, res);
|
trace_printf_key(&trace_refs,
|
||||||
|
"read_raw_ref: %s: %d (errno %d)\n", refname,
|
||||||
|
res, errno);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user