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 <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ronnie Sahlberg committed
Apr 28, 2014 at 15:36 UTC
aae383db8c384dc46abe199899235f67c838e601
2 files changed
+8
-5
refs.c
+8
-2
@@ -2706,6 +2706,9 @@ static int rename_ref_available(const char *oldname, const char *newname)
2706
return ret;
2707
}
2708
2709
+static int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1,
2710
+ const char *logmsg);
2711
+
2712
int rename_ref(const char *oldrefname, const char *newrefname, const char *logmsg)
2713
{
2714
unsigned char sha1[20], orig_sha1[20];
@@ -2950,8 +2953,11 @@ int is_branch(const char *refname)
2953
return !strcmp(refname, "HEAD") || starts_with(refname, "refs/heads/");
2954
}
2955
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,
2961
const unsigned char *sha1, const char *logmsg)
2962
{
2963
static char term = '\n';
refs.h
-3
@@ -197,9 +197,6 @@ extern int commit_ref(struct ref_lock *lock);
197
/** Release any lock taken but not written. **/
198
extern void unlock_ref(struct ref_lock *lock);
199
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
-
200
/*
201
* Setup reflog before using. Set errno to something meaningful on failure.
202
*/