Skip to content

Commit 88b680a

Browse files
rsahlberggitster
authored andcommitted
refs.c: make lock_ref_sha1 static
No external callers reference lock_ref_sha1 any more so let's declare it static. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent b6b10bb commit 88b680a

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

refs.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,7 +2069,10 @@ int dwim_log(const char *str, int len, unsigned char *sha1, char **log)
20692069
return logs_found;
20702070
}
20712071

2072-
/* This function should make sure errno is meaningful on error */
2072+
/*
2073+
* Locks a "refs/" ref returning the lock on success and NULL on failure.
2074+
* On failure errno is set to something meaningful.
2075+
*/
20732076
static struct ref_lock *lock_ref_sha1_basic(const char *refname,
20742077
const unsigned char *old_sha1,
20752078
int flags, int *type_p)
@@ -2170,7 +2173,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
21702173
return NULL;
21712174
}
21722175

2173-
struct ref_lock *lock_ref_sha1(const char *refname, const unsigned char *old_sha1)
2176+
static struct ref_lock *lock_ref_sha1(const char *refname, const unsigned char *old_sha1)
21742177
{
21752178
char refpath[PATH_MAX];
21762179
if (check_refname_format(refname, 0))

refs.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,6 @@ extern int ref_exists(const char *);
170170
*/
171171
extern int peel_ref(const char *refname, unsigned char *sha1);
172172

173-
/*
174-
* Locks a "refs/" ref returning the lock on success and NULL on failure.
175-
* On failure errno is set to something meaningful.
176-
*/
177-
extern struct ref_lock *lock_ref_sha1(const char *refname, const unsigned char *old_sha1);
178-
179173
/** Locks any ref (for 'HEAD' type refs). */
180174
#define REF_NODEREF 0x01
181175
/* errno is set to something meaningful on failure */

0 commit comments

Comments
 (0)