Re: [PATCH v8 28/44] refs.c: make write_ref_sha1 static
Thanks! On Tue, May 20, 2014 at 5:51 PM, Jonathan Nieder wrote: > Ronnie Sahlberg wrote: > >> No external users call write_ref_sha1 any more so lets declare it static. > > Yay! > > [...] >> +++ b/refs.c >> @@ -251,6 +251,8 @@ struct ref_entry { > [...] >> static void read_loose_refs(const char *dirname, struct ref_dir *dir); >> +static int write_ref_sha1(struct ref_lock *lock, >> + const unsigned char *sha1, const char *logmsg); > > Is this forward declaration needed? > No. Removed. (I could have sworn I had a patch to remove this forward declaration.) > [...] >> --- a/refs.h >> +++ b/refs.h >> @@ -150,9 +150,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); > > (nit) Would be nice to keep the documentation comment. Moved this comment to refs.c Please see ref-transactions branch Thanks! > > Thanks, > Jonathan -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v8 28/44] refs.c: make write_ref_sha1 static
Ronnie Sahlberg wrote: > No external users call write_ref_sha1 any more so lets declare it static. Yay! [...] > +++ b/refs.c > @@ -251,6 +251,8 @@ struct ref_entry { [...] > static void read_loose_refs(const char *dirname, struct ref_dir *dir); > +static int write_ref_sha1(struct ref_lock *lock, > + const unsigned char *sha1, const char *logmsg); Is this forward declaration needed? [...] > --- a/refs.h > +++ b/refs.h > @@ -150,9 +150,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); (nit) Would be nice to keep the documentation comment. Thanks, Jonathan -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v8 28/44] refs.c: make write_ref_sha1 static
No external users call write_ref_sha1 any more so lets declare it static. Signed-off-by: Ronnie Sahlberg --- refs.c | 4 +++- refs.h | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/refs.c b/refs.c index 82a8d4e..e5729ad 100644 --- a/refs.c +++ b/refs.c @@ -251,6 +251,8 @@ struct ref_entry { }; static void read_loose_refs(const char *dirname, struct ref_dir *dir); +static int write_ref_sha1(struct ref_lock *lock, + const unsigned char *sha1, const char *logmsg); static struct ref_dir *get_ref_dir(struct ref_entry *entry) { @@ -2805,7 +2807,7 @@ static int is_branch(const char *refname) return !strcmp(refname, "HEAD") || starts_with(refname, "refs/heads/"); } -int write_ref_sha1(struct ref_lock *lock, +static int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, const char *logmsg) { static char term = '\n'; diff --git a/refs.h b/refs.h index b94e1ac..796e396 100644 --- a/refs.h +++ b/refs.h @@ -150,9 +150,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. **/ int log_ref_setup(const char *refname, char *logfile, int bufsize); -- 2.0.0.rc3.477.g0f8edf7 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html