Skip to content

Commit

Permalink
reflog_expire(): integrate lock_ref_sha1_basic() errors into ours
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed May 11, 2015
1 parent 3553944 commit c628edf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c628edf

Please sign in to comment.