git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/4] bisect: fix reading more than one path in "$GIT_DIR/BISECT_NAMES"

From
Christian Couder <chriscool@tuxfamily.org>
Date
Mar 29, 2009, 09:44 UTC
Message-ID
<20090329114457.c6fca0fe.chriscool@tuxfamily.org>

The implementation of "read_bisect_paths" worked with only one path in each line of "$GIT_DIR/BISECT_NAMES", but the paths are all stored on one line by "git-bisect.sh".

So we have to process all the paths that may be on each line.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 bisect.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/bisect.c b/bisect.c
index 9e779c1..66df05f 100644
--- a/bisect.c
+++ b/bisect.c
@@ -435,17 +435,17 @@ void read_bisect_paths(void)
 		die("Could not open file '%s': %s", filename, strerror(errno));
 
 	while (strbuf_getline(&str, fp, '\n') != EOF) {
-		char *quoted, *dequoted;
+		char *quoted;
+		int res;
+
 		strbuf_trim(&str);
 		quoted = strbuf_detach(&str, NULL);
-		if (!*quoted)
-			continue;
-		dequoted = sq_dequote(quoted);
-		if (!dequoted)
+		res = sq_dequote_to_argv(quoted, &rev_argv,
+					 &rev_argv_nr, &rev_argv_alloc);
+		if (res)
 			die("Badly quoted content in file '%s': %s",
 			    filename, quoted);
-		ALLOC_GROW(rev_argv, rev_argv_nr + 1, rev_argv_alloc);
-		rev_argv[rev_argv_nr++] = dequoted;
+		free(quoted);
 	}
 
 	strbuf_release(&str);
-- 
1.6.2.1.404.gb0085.dirty
Next: Junio C Hamano
Message 1 of 3 in “bisect: fix reading more than one path in "$GIT_DIR/BISECT_NAMES"”
  1. 3/4 bisect: fix reading more than one path in "$GIT_DIR/BISECT_NAMES"Christian Couder, Mar 29, 2009
  2. Junio C HamanoMar 30, 2009
  3. Christian CouderMar 31, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.