reflog_expire(): integrate lock_ref_sha1_basic() errors into ours
[gitweb.git] / refs.c
diff --git a/refs.c b/refs.c
index bc4b1ab8b71b2d2e740426494a5b6fababb84bd0..97043fd2ef88fd50dadf05d673bb80018d3caf06 100644 (file)
--- 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);