Thread (89 messages) 89 messages, 3 authors, 2016-06-15

[PATCH 50/86] builtin/clone: replace prefixcmd() with has_prefix()

flat view
STALE3766d

From: Christian Couder <hidden>
Date: 2016-06-15 22:59:12
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Christian Couder <redacted>
---
 builtin/clone.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/clone.c b/builtin/clone.c
index 84fb1bd..49b7a08 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -508,7 +508,7 @@ static void write_followtags(const struct ref *refs, const char *msg)
 {
 	const struct ref *ref;
 	for (ref = refs; ref; ref = ref->next) {
-		if (prefixcmp(ref->name, "refs/tags/"))
+		if (!has_prefix(ref->name, "refs/tags/"))
 			continue;
 		if (has_suffix(ref->name, "^{}"))
 			continue;
@@ -578,7 +578,7 @@ static void update_remote_refs(const struct ref *refs,
 static void update_head(const struct ref *our, const struct ref *remote,
 			const char *msg)
 {
-	if (our && !prefixcmp(our->name, "refs/heads/")) {
+	if (our && has_prefix(our->name, "refs/heads/")) {
 		/* Local default branch link */
 		create_symref("HEAD", our->name, NULL);
 		if (!option_bare) {
@@ -625,7 +625,7 @@ static int checkout(void)
 		if (advice_detached_head)
 			detach_advice(sha1_to_hex(sha1));
 	} else {
-		if (prefixcmp(head, "refs/heads/"))
+		if (!has_prefix(head, "refs/heads/"))
 			die(_("HEAD not found below refs/heads!"));
 	}
 	free(head);
-- 
1.8.4.1.566.geca833c
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help