Thread (23 messages) flat view 23 messages, 1 author, 2016-06-15
DORMANTno replies

Revision v2 of 3 in this series.

Revisions (3)
  1. v1 [diff vs current]
  2. v2 current
  3. v3 [diff vs current]

[PATCH v2 15/23] refs-common.c: move prettify_refname to the common code

From: Ronnie Sahlberg <hidden>
Date: 2016-06-15 23:02:16
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Ronnie Sahlberg <redacted>
---
 refs-common.c | 9 +++++++++
 refs.c        | 9 ---------
 2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/refs-common.c b/refs-common.c
index 6eef80b..d8a295c 100644
--- a/refs-common.c
+++ b/refs-common.c
@@ -3,6 +3,15 @@
 #include "refs.h"
 #include "string-list.h"
 
+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);
+}
+
 int names_conflict(const char *refname1, const char *refname2)
 {
 	for (; *refname1 && *refname1 == *refname2; refname1++, refname2++)
diff --git a/refs.c b/refs.c
index 6542969..fb9c614 100644
--- a/refs.c
+++ b/refs.c
@@ -1747,15 +1747,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 */
-- 
2.0.1.556.g3edca4c
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help