Thread (51 messages) flat view 51 messages, 4 authors, 2016-06-15
STALE3746d

[PATCH 09/13] transport-helper: Use capname for gitdir capability too

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:49:24
Subsystem: the rest · Maintainer: Linus Torvalds

Also properly use capname in the refspec capability.

Previously the gitdir and refspec capabilities could not be listed as
required or their parsing would break.

CC: Ilari Liusvaara <redacted>
CC: Daniel Barkalow <redacted>
---

  The first hunk was real silly and I should have caught it while
  reviewing the patch that introduced the required capabilities.

  I suspect the reason the second hunk wasn't caught is because the
  series that added 'gitdir' as capability, and the one that added
  required capabilities were done in parallel.

 transport-helper.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/transport-helper.c b/transport-helper.c
index 1294d10..82bdad3 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -171,10 +171,10 @@ static struct child_process *get_helper(struct transport *transport)
 			ALLOC_GROW(refspecs,
 				   refspec_nr + 1,
 				   refspec_alloc);
-			refspecs[refspec_nr++] = strdup(buf.buf + strlen("refspec "));
+			refspecs[refspec_nr++] = strdup(capname + strlen("refspec "));
 		} else if (!strcmp(capname, "connect")) {
 			data->connect = 1;
-		} else if (!strcmp(buf.buf, "gitdir")) {
+		} else if (!strcmp(capname, "gitdir")) {
 			struct strbuf gitdir = STRBUF_INIT;
 			strbuf_addf(&gitdir, "gitdir %s\n", get_git_dir());
 			sendline(data, &gitdir);
-- 
1.7.2.1.240.g6a95c3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help