Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
rename_ref(): integrate lock_ref_sha1_basic() errors into ours
author
Michael Haggerty
<mhagger@alum.mit.edu>
Mon, 11 May 2015 15:25:17 +0000
(17:25 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 11 May 2015 18:50:20 +0000
(11:50 -0700)
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>
refs.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
5b2d8d6
)
diff --git
a/refs.c
b/refs.c
index ce993bd12566fe8ba76057fb36076624e5094789..87c1ad161d3d8b86c104011b65190bf27d3541cb 100644
(file)
--- a/
refs.c
+++ b/
refs.c
@@
-2907,9
+2907,8
@@
int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
lock = lock_ref_sha1_basic(newrefname, NULL, NULL, NULL, 0, NULL, &err);
if (!lock) {
lock = lock_ref_sha1_basic(newrefname, NULL, NULL, NULL, 0, NULL, &err);
if (!lock) {
- error("
%s"
, err.buf);
+ error("
unable to rename '%s' to '%s': %s", oldrefname, newrefname
, err.buf);
strbuf_release(&err);
strbuf_release(&err);
- error("unable to lock %s for update", newrefname);
goto rollback;
}
hashcpy(lock->old_sha1, orig_sha1);
goto rollback;
}
hashcpy(lock->old_sha1, orig_sha1);
@@
-2923,9
+2922,8
@@
int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
rollback:
lock = lock_ref_sha1_basic(oldrefname, NULL, NULL, NULL, 0, NULL, &err);
if (!lock) {
rollback:
lock = lock_ref_sha1_basic(oldrefname, NULL, NULL, NULL, 0, NULL, &err);
if (!lock) {
- error("
%s"
, err.buf);
+ error("
unable to lock %s for rollback: %s", oldrefname
, err.buf);
strbuf_release(&err);
strbuf_release(&err);
- error("unable to lock %s for rollback", oldrefname);
goto rollbacklog;
}
goto rollbacklog;
}