Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
lock_any_ref_for_update(): inline function
author
Michael Haggerty
<mhagger@alum.mit.edu>
Fri, 12 Dec 2014 08:57:01 +0000
(09:57 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 22 Dec 2014 18:13:15 +0000
(10:13 -0800)
Inline the function at its one remaining caller (which is within
refs.c) and remove it.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
patch
|
blob
|
history
refs.h
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
0b1e654
)
diff --git
a/refs.c
b/refs.c
index bf152aab32d2fee0fc51335850a71a93f207b0d8..55a79429bd0ec69e8245e515d353a15234377b1d 100644
(file)
--- a/
refs.c
+++ b/
refs.c
@@
-2346,13
+2346,6
@@
static struct ref_lock *lock_ref_sha1_basic(const char *refname,
return NULL;
}
return NULL;
}
-struct ref_lock *lock_any_ref_for_update(const char *refname,
- const unsigned char *old_sha1,
- int flags, int *type_p)
-{
- return lock_ref_sha1_basic(refname, old_sha1, NULL, flags, type_p);
-}
-
/*
* Write an entry to the packed-refs file for the specified refname.
* If peeled is non-NULL, write it as the entry's peeled value.
/*
* Write an entry to the packed-refs file for the specified refname.
* If peeled is non-NULL, write it as the entry's peeled value.
@@
-4007,7
+4000,7
@@
int reflog_expire(const char *refname, const unsigned char *sha1,
* reference itself, plus we might need to update the
* reference if --updateref was specified:
*/
* reference itself, plus we might need to update the
* reference if --updateref was specified:
*/
- lock = lock_
any_ref_for_update(refname, sha1
, 0, NULL);
+ lock = lock_
ref_sha1_basic(refname, sha1, NULL
, 0, NULL);
if (!lock)
return error("cannot lock ref '%s'", refname);
if (!reflog_exists(refname)) {
if (!lock)
return error("cannot lock ref '%s'", refname);
if (!reflog_exists(refname)) {
diff --git
a/refs.h
b/refs.h
index 4bb58b96868389c45f7af021bf29b754ecc6d7ea..28e7834da46e5a859a69da6452f2b8a2841a0528 100644
(file)
--- a/
refs.h
+++ b/
refs.h
@@
-181,8
+181,7
@@
extern int is_branch(const char *refname);
extern int peel_ref(const char *refname, unsigned char *sha1);
/*
extern int peel_ref(const char *refname, unsigned char *sha1);
/*
- * Flags controlling lock_any_ref_for_update(), ref_transaction_update(),
- * ref_transaction_create(), etc.
+ * Flags controlling ref_transaction_update(), ref_transaction_create(), etc.
* REF_NODEREF: act on the ref directly, instead of dereferencing
* symbolic references.
* REF_DELETING: tolerate broken refs
* REF_NODEREF: act on the ref directly, instead of dereferencing
* symbolic references.
* REF_DELETING: tolerate broken refs
@@
-191,12
+190,6
@@
extern int peel_ref(const char *refname, unsigned char *sha1);
*/
#define REF_NODEREF 0x01
#define REF_DELETING 0x02
*/
#define REF_NODEREF 0x01
#define REF_DELETING 0x02
-/*
- * This function sets errno to something meaningful on failure.
- */
-extern struct ref_lock *lock_any_ref_for_update(const char *refname,
- const unsigned char *old_sha1,
- int flags, int *type_p);
/*
* Setup reflog before using. Set errno to something meaningful on failure.
/*
* Setup reflog before using. Set errno to something meaningful on failure.