diff options
author | Ronnie Sahlberg <sahlberg@google.com> | 2014-04-29 02:36:58 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-10-15 21:47:23 +0400 |
commit | aae383db8c384dc46abe199899235f67c838e601 (patch) | |
tree | 36c728e86bc1218253eb70eb595b6508d6b867fc | |
parent | cd94f765720e32ea0bf72996c8dc7dd0b1cc30d0 (diff) |
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>
-rw-r--r-- | refs.c | 10 | ||||
-rw-r--r-- | refs.h | 3 |
2 files changed, 8 insertions, 5 deletions
@@ -2706,6 +2706,9 @@ static int rename_ref_available(const char *oldname, const char *newname) return ret; } +static int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, + const char *logmsg); + int rename_ref(const char *oldrefname, const char *newrefname, const char *logmsg) { unsigned char sha1[20], orig_sha1[20]; @@ -2950,8 +2953,11 @@ int is_branch(const char *refname) return !strcmp(refname, "HEAD") || starts_with(refname, "refs/heads/"); } -/* This function must return a meaningful errno */ -int write_ref_sha1(struct ref_lock *lock, +/* + * Write sha1 into the ref specified by the lock. Make sure that errno + * is sane on error. + */ +static int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, const char *logmsg) { static char term = '\n'; @@ -197,9 +197,6 @@ extern int commit_ref(struct ref_lock *lock); /** Release any lock taken but not written. **/ extern void unlock_ref(struct ref_lock *lock); -/** Writes sha1 into the ref specified by the lock. **/ -extern int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, const char *msg); - /* * Setup reflog before using. Set errno to something meaningful on failure. */ |