From: David Turner Date: Thu, 15 Oct 2015 19:46:39 GMT Subject: [PATCH v4 15/26] refs.c: move prettify_refname to the common code Message-ID: <1444938410-2345-16-git-send-email-dturner@twopensource.com> In-Reply-To: <1444938410-2345-1-git-send-email-dturner@twopensource.com> From: Ronnie Sahlberg Signed-off-by: Ronnie Sahlberg Signed-off-by: Junio C Hamano --- refs-be-files.c | 9 --------- refs.c | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/refs-be-files.c b/refs-be-files.c index 5c6c743..c8b44ab 100644 --- a/refs-be-files.c +++ b/refs-be-files.c @@ -2052,15 +2052,6 @@ int for_each_rawref(each_ref_fn fn, void *cb_data) DO_FOR_EACH_INCLUDE_BROKEN, cb_data); } -const char *prettify_refname(const char *name) -{ - return name + ( - starts_with(name, "refs/heads/") ? 11 : - starts_with(name, "refs/tags/") ? 10 : - starts_with(name, "refs/remotes/") ? 13 : - 0); -} - static void unlock_ref(struct ref_lock *lock) { /* Do not free lock->lk -- atexit() still looks at them */ diff --git a/refs.c b/refs.c index f2f8052..642a2ab 100644 --- a/refs.c +++ b/refs.c @@ -737,3 +737,12 @@ int is_branch(const char *refname) { return !strcmp(refname, "HEAD") || starts_with(refname, "refs/heads/"); } + +const char *prettify_refname(const char *name) +{ + return name + ( + starts_with(name, "refs/heads/") ? 11 : + starts_with(name, "refs/tags/") ? 10 : + starts_with(name, "refs/remotes/") ? 13 : + 0); +} -- 2.4.2.644.g97b850b-twtrsrc