diff options
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/receive-pack.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 94d3e73cee..70e04b3efb 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -1813,11 +1813,14 @@ static void ref_transaction_rejection_handler(const char *refname, const char *old_target UNUSED, const char *new_target UNUSED, enum ref_transaction_error err, - const char *details UNUSED, + const char *details, void *cb_data) { struct strmap *failed_refs = cb_data; + if (details) + rp_error("%s", details); + strmap_put(failed_refs, refname, (char *)ref_transaction_error_msg(err)); } @@ -1884,6 +1887,7 @@ static void execute_commands_non_atomic(struct command *commands, } ref_transaction_for_each_rejected_update(transaction, + ref_transaction_rejection_handler, &failed_refs); @@ -1895,7 +1899,7 @@ static void execute_commands_non_atomic(struct command *commands, if (reported_error) cmd->error_string = reported_error; else if (strmap_contains(&failed_refs, cmd->ref_name)) - cmd->error_string = strmap_get(&failed_refs, cmd->ref_name); + cmd->error_string = cmd->error_string_owned = xstrdup(strmap_get(&failed_refs, cmd->ref_name)); } cleanup: |
