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

[PATCH] fast-import: fix option parser forno-arg options

From
Sverre Rabbelier <srabbelier@gmail.com>
Date
May 5, 2011, 18:56 UTC
Message-ID
<1304621760-22261-1-git-send-email-srabbelier@gmail.com>
In-Reply-To
<7v7ha59icw.fsf@alter.siamese.dyndns.org>

While refactoring the options parser in bc3c79a (fast-import: add (non-)relative-marks feature, 2009-12-04), it was made too lenient for options that take no argument, fix that.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
---
  I noticed that force was also wrong. All other option parsing
  checks are made using the right version though.
 fast-import.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index 3e4e655..78d9786 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -3135,11 +3135,11 @@ static int parse_one_feature(const char *feature, int from_stream)
 		option_export_marks(feature + 13);
 	} else if (!strcmp(feature, "cat-blob")) {
 		; /* Don't die - this feature is supported */
-	} else if (!prefixcmp(feature, "relative-marks")) {
+	} else if (!strcmp(feature, "relative-marks")) {
 		relative_marks_paths = 1;
-	} else if (!prefixcmp(feature, "no-relative-marks")) {
+	} else if (!strcmp(feature, "no-relative-marks")) {
 		relative_marks_paths = 0;
-	} else if (!prefixcmp(feature, "force")) {
+	} else if (!strcmp(feature, "force")) {
 		force_update = 1;
 	} else if (!strcmp(feature, "notes") || !strcmp(feature, "ls")) {
 		; /* do nothing; we have the feature */
-- 
1.7.5.1.292.g728120
Previous: Junio C Hamano
Message 3 of 3 in “git-fast-import.txt: --relative-marks takes no parameter”
  1. git-fast-import.txt: --relative-marks takes no parameterMichael J Gruber, May 5, 2011
  2. Junio C HamanoMay 5, 2011
  3. fast-import: fix option parser forno-arg optionsSverre Rabbelier, May 5, 2011

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.