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 <mhagger@alum.mit.edu>
Michael Haggerty committed
May 11, 2015 at 17:25 UTC
c628edfddbf37eefab810a3107a2c32b45abaedc
1 file changed
+2
-2
refs.c
+2
-2
@@ -4118,9 +4118,9 @@ int reflog_expire(const char *refname, const unsigned char *sha1,
4118
*/
4119
lock = lock_ref_sha1_basic(refname, sha1, NULL, NULL, 0, &type, &err);
4120
if (!lock) {
4121
- error("%s", err.buf);
4121
+ error("cannot lock ref '%s': %s", refname, err.buf);
4122
strbuf_release(&err);
4123
- return error("cannot lock ref '%s'", refname);
4123
+ return -1;
4124
}
4125
if (!reflog_exists(refname)) {
4126
unlock_ref(lock);