diff options
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -3838,13 +3838,15 @@ int ref_transaction_commit(struct ref_transaction *transaction, &update->type, err); if (!update->lock) { + char *reason; + ret = (errno == ENOTDIR) ? TRANSACTION_NAME_CONFLICT : TRANSACTION_GENERIC_ERROR; - error("%s", err->buf); - strbuf_reset(err); - strbuf_addf(err, "Cannot lock the ref '%s'.", - update->refname); + reason = strbuf_detach(err, NULL); + strbuf_addf(err, "Cannot lock the ref '%s': %s", + update->refname, reason); + free(reason); goto cleanup; } } |