Re: [PATCH 01/11] refs-internal.c: make files_log_ref_write() static
flat view
From: Duy Nguyen <hidden>
Date: 2017-02-14 09:24:20
On Tue, Feb 14, 2017 at 3:14 AM, Ramsay Jones [off-list ref] wrote:
On 13/02/17 15:20, Nguyễn Thái Ngọc Duy wrote:quoted
Created in 5f3c3a4e6f (files_log_ref_write: new function - 2015-11-10) but probably never used outside refs-internal.c Signed-off-by: Nguyễn Thái Ngọc Duy <redacted> --- refs/files-backend.c | 3 +++ refs/refs-internal.h | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-)diff --git a/refs/files-backend.c b/refs/files-backend.c index cdb6b8ff5..75565c3aa 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c@@ -165,6 +165,9 @@ static struct ref_entry *create_dir_entry(struct files_ref_store *ref_store, const char *dirname, size_t len, int incomplete); static void add_entry_to_dir(struct ref_dir *dir, struct ref_entry *entry); +static int files_log_ref_write(const char *refname, const unsigned char *old_sha1, + const unsigned char *new_sha1, const char *msg, + int flags, struct strbuf *err);Why? I don't like adding forward declarations unless it is absolutely necessary (ie mutually recursive functions), and even in the current 'pu' branch (@c04899d50), the definition of this function appears before all uses in this file. (ie, just add static to the definition). What am I missing?
It may have been needed at one point. With all the code changes and movements, I guess I forgot to remove it. -- Duy