Skip to content

Commit 31e07f7

Browse files
mhaggergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0b1e654 commit 31e07f7

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

refs.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2346,13 +2346,6 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
23462346
return NULL;
23472347
}
23482348

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-
23562349
/*
23572350
* Write an entry to the packed-refs file for the specified refname.
23582351
* 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,
40074000
* reference itself, plus we might need to update the
40084001
* reference if --updateref was specified:
40094002
*/
4010-
lock = lock_any_ref_for_update(refname, sha1, 0, NULL);
4003+
lock = lock_ref_sha1_basic(refname, sha1, NULL, 0, NULL);
40114004
if (!lock)
40124005
return error("cannot lock ref '%s'", refname);
40134006
if (!reflog_exists(refname)) {

refs.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ extern int is_branch(const char *refname);
181181
extern int peel_ref(const char *refname, unsigned char *sha1);
182182

183183
/*
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.
186185
* REF_NODEREF: act on the ref directly, instead of dereferencing
187186
* symbolic references.
188187
* REF_DELETING: tolerate broken refs
@@ -191,12 +190,6 @@ extern int peel_ref(const char *refname, unsigned char *sha1);
191190
*/
192191
#define REF_NODEREF 0x01
193192
#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);
200193

201194
/*
202195
* Setup reflog before using. Set errno to something meaningful on failure.

0 commit comments

Comments
 (0)