Skip to content

Commit aae383d

Browse files
rsahlberggitster
authored andcommitted
refs.c: make write_ref_sha1 static
No external users call write_ref_sha1 any more so let's declare it static. Signed-off-by: Ronnie Sahlberg <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cd94f76 commit aae383d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

refs.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2706,6 +2706,9 @@ static int rename_ref_available(const char *oldname, const char *newname)
27062706
return ret;
27072707
}
27082708

2709+
static int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1,
2710+
const char *logmsg);
2711+
27092712
int rename_ref(const char *oldrefname, const char *newrefname, const char *logmsg)
27102713
{
27112714
unsigned char sha1[20], orig_sha1[20];
@@ -2950,8 +2953,11 @@ int is_branch(const char *refname)
29502953
return !strcmp(refname, "HEAD") || starts_with(refname, "refs/heads/");
29512954
}
29522955

2953-
/* This function must return a meaningful errno */
2954-
int write_ref_sha1(struct ref_lock *lock,
2956+
/*
2957+
* Write sha1 into the ref specified by the lock. Make sure that errno
2958+
* is sane on error.
2959+
*/
2960+
static int write_ref_sha1(struct ref_lock *lock,
29552961
const unsigned char *sha1, const char *logmsg)
29562962
{
29572963
static char term = '\n';

refs.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,6 @@ extern int commit_ref(struct ref_lock *lock);
197197
/** Release any lock taken but not written. **/
198198
extern void unlock_ref(struct ref_lock *lock);
199199

200-
/** Writes sha1 into the ref specified by the lock. **/
201-
extern int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, const char *msg);
202-
203200
/*
204201
* Setup reflog before using. Set errno to something meaningful on failure.
205202
*/

0 commit comments

Comments
 (0)