Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
rename_ref(): inline calls to write_ref_sha1() from this function
author
Michael Haggerty
<mhagger@alum.mit.edu>
Sat, 9 May 2015 15:20:39 +0000
(17:20 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 13 May 2015 04:28:02 +0000
(21:28 -0700)
Most of what it does is unneeded from these call sites.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
ad4cd6c
)
diff --git
a/refs.c
b/refs.c
index 3db88e0b2ad09d826ae20909bfe3dc3502908885..ad4b6d520281579c9814c6b8cfdb7f238f645299 100644
(file)
--- a/
refs.c
+++ b/
refs.c
@@
-2773,8
+2773,9
@@
static int rename_ref_available(const char *oldname, const char *newname)
return ret;
}
return ret;
}
-static int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1,
- const char *logmsg);
+static int write_ref_to_lockfile(struct ref_lock *lock, const unsigned char *sha1);
+static int commit_ref_update(struct ref_lock *lock,
+ const unsigned char *sha1, const char *logmsg);
int rename_ref(const char *oldrefname, const char *newrefname, const char *logmsg)
{
int rename_ref(const char *oldrefname, const char *newrefname, const char *logmsg)
{
@@
-2832,7
+2833,9
@@
int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
goto rollback;
}
hashcpy(lock->old_sha1, orig_sha1);
goto rollback;
}
hashcpy(lock->old_sha1, orig_sha1);
- if (write_ref_sha1(lock, orig_sha1, logmsg)) {
+
+ if (write_ref_to_lockfile(lock, orig_sha1) ||
+ commit_ref_update(lock, orig_sha1, logmsg)) {
error("unable to write current sha1 into %s", newrefname);
goto rollback;
}
error("unable to write current sha1 into %s", newrefname);
goto rollback;
}
@@
-2848,7
+2851,8
@@
int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
flag = log_all_ref_updates;
log_all_ref_updates = 0;
flag = log_all_ref_updates;
log_all_ref_updates = 0;
- if (write_ref_sha1(lock, orig_sha1, NULL))
+ if (write_ref_to_lockfile(lock, orig_sha1) ||
+ commit_ref_update(lock, orig_sha1, NULL))
error("unable to write current sha1 into %s", oldrefname);
log_all_ref_updates = flag;
error("unable to write current sha1 into %s", oldrefname);
log_all_ref_updates = flag;