lock_any_ref_for_update(): inline function
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>
Michael Haggerty committed
Dec 12, 2014 at 09:57 UTC
31e07f76a946831265e741333a3d9e0646c793ad
2 files changed
+2
-16
refs.c
+1
-8
@@ -2346,13 +2346,6 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
2346
return NULL;
2347
}
2348
2349
-struct ref_lock *lock_any_ref_for_update(const char *refname,
2350
- const unsigned char *old_sha1,
2351
- int flags, int *type_p)
2352
-{
2353
- return lock_ref_sha1_basic(refname, old_sha1, NULL, flags, type_p);
2354
-}
2355
-
2349
/*
2350
* Write an entry to the packed-refs file for the specified refname.
2351
* 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,
4000
* reference itself, plus we might need to update the
4001
* reference if --updateref was specified:
4002
*/
4010
- lock = lock_any_ref_for_update(refname, sha1, 0, NULL);
4003
+ lock = lock_ref_sha1_basic(refname, sha1, NULL, 0, NULL);
4004
if (!lock)
4005
return error("cannot lock ref '%s'", refname);
4006
if (!reflog_exists(refname)) {
refs.h
+1
-8
@@ -181,8 +181,7 @@ extern int is_branch(const char *refname);
181
extern int peel_ref(const char *refname, unsigned char *sha1);
182
183
/*
184
- * Flags controlling lock_any_ref_for_update(), ref_transaction_update(),
185
- * ref_transaction_create(), etc.
184
+ * Flags controlling ref_transaction_update(), ref_transaction_create(), etc.
185
* REF_NODEREF: act on the ref directly, instead of dereferencing
186
* symbolic references.
187
* REF_DELETING: tolerate broken refs
@@ -191,12 +190,6 @@ extern int peel_ref(const char *refname, unsigned char *sha1);
190
*/
191
#define REF_NODEREF 0x01
192
#define REF_DELETING 0x02
194
-/*
195
- * This function sets errno to something meaningful on failure.
196
- */
197
-extern struct ref_lock *lock_any_ref_for_update(const char *refname,
198
- const unsigned char *old_sha1,
199
- int flags, int *type_p);
193
194
/*
195
* Setup reflog before using. Set errno to something meaningful on failure.