Skip to content

Commit c628edf

Browse files
mhaggergitster
authored andcommitted
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 <[email protected]>
1 parent 3553944 commit c628edf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

refs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4118,9 +4118,9 @@ int reflog_expire(const char *refname, const unsigned char *sha1,
41184118
*/
41194119
lock = lock_ref_sha1_basic(refname, sha1, NULL, NULL, 0, &type, &err);
41204120
if (!lock) {
4121-
error("%s", err.buf);
4121+
error("cannot lock ref '%s': %s", refname, err.buf);
41224122
strbuf_release(&err);
4123-
return error("cannot lock ref '%s'", refname);
4123+
return -1;
41244124
}
41254125
if (!reflog_exists(refname)) {
41264126
unlock_ref(lock);

0 commit comments

Comments
 (0)