threads / patch / 54432

patchfast-import: remove duplicated option-parsing line

Subject: [PATCH] fast-import: remove duplicated option-parsing line

## tl;dr

3 messages between Oct 15, 2020 and Oct 17, 2020. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Jeff King· Oct 15, 2020, 19:34 UTC · lore

Commit 1bdca81641 (fast-import: add options for rewriting submodules, 2020-02-22) accidentally added two lines parsing the option "rewrite-submodules-from". This didn't do anything in practice, because they're in an if/else chain and so the second one can never trigger.

Signed-off-by: Jeff King <peff@peff.net>
---
Another tidbit I noticed in my foray into fast-import earlier today.
 builtin/fast-import.c | 1 -
 1 file changed, 1 deletion(-)
Show changes to builtin/fast-import.c +0 −1
diff --git a/builtin/fast-import.c b/builtin/fast-import.c
index 70d7d25eed..dd4d09cece 100644
--- a/builtin/fast-import.c
+++ b/builtin/fast-import.c
@@ -3399,7 +3399,6 @@ static int parse_one_feature(const char *feature, int from_stream)
 		option_rewrite_submodules(arg, &sub_marks_to);
 	} else if (skip_prefix(feature, "rewrite-submodules-from=", &arg)) {
 		option_rewrite_submodules(arg, &sub_marks_from);
-	} else if (skip_prefix(feature, "rewrite-submodules-from=", &arg)) {
 	} else if (!strcmp(feature, "get-mark")) {
 		; /* Don't die - this feature is supported */
 	} else if (!strcmp(feature, "cat-blob")) {
-- 
2.29.0.rc1.562.g7bd9bc8902
Junio C Hamano· Oct 16, 2020, 15:49 UTC · re: Jeff King · lore

Re: [PATCH] fast-import: remove duplicated option-parsing line

Jeff King <peff@peff.net> writes:
> Commit 1bdca81641 (fast-import: add options for rewriting submodules,
> 2020-02-22) accidentally added two lines parsing the option
> "rewrite-submodules-from". This didn't do anything in practice, because
> they're in an if/else chain and so the second one can never trigger.

Thanks; it is embarrassing of me that I didn't see it while applying.

Show 20 quoted lines
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> Another tidbit I noticed in my foray into fast-import earlier today.
>
>  builtin/fast-import.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/builtin/fast-import.c b/builtin/fast-import.c
> index 70d7d25eed..dd4d09cece 100644
> --- a/builtin/fast-import.c
> +++ b/builtin/fast-import.c
> @@ -3399,7 +3399,6 @@ static int parse_one_feature(const char *feature, int from_stream)
>  		option_rewrite_submodules(arg, &sub_marks_to);
>  	} else if (skip_prefix(feature, "rewrite-submodules-from=", &arg)) {
>  		option_rewrite_submodules(arg, &sub_marks_from);
> -	} else if (skip_prefix(feature, "rewrite-submodules-from=", &arg)) {
>  	} else if (!strcmp(feature, "get-mark")) {
>  		; /* Don't die - this feature is supported */
>  	} else if (!strcmp(feature, "cat-blob")) {
brian m. carlson· Oct 17, 2020, 23:08 UTC · re: Jeff King · lore

Re: [PATCH] fast-import: remove duplicated option-parsing line

On 2020-10-15 at 19:34:11, Jeff King wrote:
Show 6 quoted lines
> Commit 1bdca81641 (fast-import: add options for rewriting submodules,
> 2020-02-22) accidentally added two lines parsing the option
> "rewrite-submodules-from". This didn't do anything in practice, because
> they're in an if/else chain and so the second one can never trigger.
> 
> Signed-off-by: Jeff King <peff@peff.net>
This seems clearly correct.
-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US

← back to recent threads