From: Michael Haggerty Date: Mon, 11 May 2015 15:25:20 +0000 (+0200) Subject: reflog_expire(): integrate lock_ref_sha1_basic() errors into ours X-Git-Tag: v2.4.3~14^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c628edfddbf37eefab810a3107a2c32b45abaedc?ds=inline reflog_expire(): integrate lock_ref_sha1_basic() errors into ours Now that lock_ref_sha1_basic() gives us back its error messages via a strbuf, incorporate its error message into our error message rather than emitting two separate error messages. Signed-off-by: Michael Haggerty --- diff --git a/refs.c b/refs.c index bc4b1ab8b7..97043fd2ef 100644 --- a/refs.c +++ b/refs.c @@ -4118,9 +4118,9 @@ int reflog_expire(const char *refname, const unsigned char *sha1, */ lock = lock_ref_sha1_basic(refname, sha1, NULL, NULL, 0, &type, &err); if (!lock) { - error("%s", err.buf); + error("cannot lock ref '%s': %s", refname, err.buf); strbuf_release(&err); - return error("cannot lock ref '%s'", refname); + return -1; } if (!reflog_exists(refname)) { unlock_ref(lock);