diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-04-30 13:50:27 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-30 13:50:27 +0900 |
commit | bf0d4c84917025652e4ecf401ec55d130ad6f5a6 (patch) | |
tree | 35253d61be939f8a695e8d089f315c6792e9d199 | |
parent | Merge branch 'mt/parallel-checkout-part-2' (diff) | |
parent | refs: print errno for read_raw_ref if GIT_TRACE_REFS is set (diff) | |
download | tgif-bf0d4c84917025652e4ecf401ec55d130ad6f5a6.tar.xz |
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
-rw-r--r-- | refs/debug.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/refs/debug.c b/refs/debug.c index 922e64fa6a..576bf98e74 100644 --- a/refs/debug.c +++ b/refs/debug.c @@ -244,6 +244,7 @@ static int debug_read_raw_ref(struct ref_store *ref_store, const char *refname, int res = 0; oidcpy(oid, &null_oid); + errno = 0; res = drefs->refs->be->read_raw_ref(drefs->refs, refname, oid, referent, 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", refname, oid_to_hex(oid), referent->buf, *type, res); } 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; } |