diff options
Diffstat (limited to 'refs/debug.c')
-rw-r--r-- | refs/debug.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/refs/debug.c b/refs/debug.c index 8667c64023..2b0771ca53 100644 --- a/refs/debug.c +++ b/refs/debug.c @@ -26,7 +26,8 @@ struct ref_store *maybe_debug_wrap_ref_store(const char *gitdir, struct ref_stor be_copy->name = store->be->name; trace_printf_key(&trace_refs, "ref_store for %s\n", gitdir); res->refs = store; - base_ref_store_init((struct ref_store *)res, be_copy); + base_ref_store_init((struct ref_store *)res, store->repo, gitdir, + be_copy); return (struct ref_store *)res; } @@ -47,7 +48,8 @@ static int debug_transaction_prepare(struct ref_store *refs, transaction->ref_store = drefs->refs; res = drefs->refs->be->transaction_prepare(drefs->refs, transaction, err); - trace_printf_key(&trace_refs, "transaction_prepare: %d\n", res); + trace_printf_key(&trace_refs, "transaction_prepare: %d \"%s\"\n", res, + err->buf); return res; } @@ -284,6 +286,7 @@ static int debug_print_reflog_ent(struct object_id *old_oid, int ret; char o[GIT_MAX_HEXSZ + 1] = "null"; char n[GIT_MAX_HEXSZ + 1] = "null"; + char *msgend = strchrnul(msg, '\n'); if (old_oid) oid_to_hex_r(o, old_oid); if (new_oid) @@ -291,8 +294,10 @@ static int debug_print_reflog_ent(struct object_id *old_oid, ret = dbg->fn(old_oid, new_oid, committer, timestamp, tz, msg, dbg->cb_data); - trace_printf_key(&trace_refs, "reflog_ent %s (ret %d): %s -> %s, %s %ld \"%s\"\n", - dbg->refname, ret, o, n, committer, (long int)timestamp, msg); + trace_printf_key(&trace_refs, + "reflog_ent %s (ret %d): %s -> %s, %s %ld \"%.*s\"\n", + dbg->refname, ret, o, n, committer, + (long int)timestamp, (int)(msgend - msg), msg); return ret; } @@ -339,11 +344,10 @@ static int debug_reflog_exists(struct ref_store *ref_store, const char *refname) } static int debug_create_reflog(struct ref_store *ref_store, const char *refname, - int force_create, struct strbuf *err) + struct strbuf *err) { struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store; - int res = drefs->refs->be->create_reflog(drefs->refs, refname, - force_create, err); + int res = drefs->refs->be->create_reflog(drefs->refs, refname, err); trace_printf_key(&trace_refs, "create_reflog: %s: %d\n", refname, res); return res; } |