Thread (1 message) 1 message, 1 author, 2017-06-16

Re: [PATCH 1/5] remote: don't use remote->{fetch,push}_refspec

From: Junio C Hamano <hidden>
Date: 2017-06-16 22:00:58

SZEDER Gábor [off-list ref] writes:
quoted hunk
diff --git a/remote.c b/remote.c
index 336db8298..a021decee 100644
--- a/remote.c
+++ b/remote.c
@@ -919,6 +919,26 @@ char *apply_refspecs(struct refspec *refspecs, int nr_refspec,
 	return query.dst;
 }
 
+void strbuf_add_refspec(struct strbuf *sb, const struct refspec *refspec)
+{
+	if (refspec->force)
+		strbuf_addch(sb, '+');
+	if (refspec->src)
+		strbuf_addstr(sb, refspec->src);
+	if (refspec->dst) {
+		strbuf_addch(sb, ':');
+		strbuf_addstr(sb, refspec->dst);
+	} else if (!refspec->src)
+		strbuf_addch(sb, ':');
+}
Hmph, don't we support wildcarding (aka refspec->pattern)?

    ... goes and looks ...

Ah, even when we set the .pattern bit, we retain '*' in the string,
so the above is correct.

The last one looks a bit sloppy; shouldn't it be inspecting the
.matching bit?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help