[PATCH v15 27/27] bisect--helper: remove the dequote in bisect_start()
- From
Pranit Bauva <pranit.bauva@gmail.com>
- Date
- Oct 14, 2016, 14:14 UTC
- Message-ID
- <01020157c38b1b58-947a88c6-2da5-4b64-8802-94127516cb6b-000000@eu-west-1.amazonses.com>
- In-Reply-To
- <01020157c38b19e0-81123fa5-5d9d-4f64-8f1b-ff336e83ebe4-000000@eu-west-1.amazonses.com>
Dequoting the arguments was introduced in 25b48b5c to port the function `bisect_next()` but after the `bisect_replay()` porting, the dequoting is carried out itself when it passes the arguments to `bisect_start()` in a simpler way thus dequoting again isn't required. So remove the extra "deqouting" code introduced by the commit 25b48b5c.
Mentored-by: Lars Schneider <larsxschneider@gmail.com> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com> --- builtin/bisect--helper.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index d6c2efc..8cd6527 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -561,24 +561,16 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout, no_checkout = 1; for (i = 0; i < argc; i++) { - const char *arg; - if (starts_with(argv[i], "'")) - arg = sq_dequote(xstrdup(argv[i])); - else - arg = argv[i]; - if (!strcmp(arg, "--")) { + if (!strcmp(argv[i], "--")) { has_double_dash = 1; break; } } for (i = 0; i < argc; i++) { - const char *arg, *commit_id; - if (starts_with(argv[i], "'")) - arg = sq_dequote(xstrdup(argv[i])); - else - arg = argv[i]; - commit_id = xstrfmt("%s^{commit}", arg); + const char *commit_id; + const char *arg = argv[i]; + commit_id = xstrfmt("%s^{commit}", argv[i]); if (!strcmp(argv[i], "--")) { has_double_dash = 1; break; @@ -586,11 +578,8 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout, no_checkout = 1; } else if (!strcmp(arg, "--term-good") || !strcmp(arg, "--term-old")) { - if (starts_with(argv[++i], "'")) - terms->term_good = sq_dequote(xstrdup(argv[i])); - else - terms->term_good = xstrdup(argv[i]); must_write_terms = 1; + terms->term_good = xstrdup(argv[++i]); } else if (skip_prefix(arg, "--term-good=", &arg)) { must_write_terms = 1; terms->term_good = arg; @@ -599,10 +588,7 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout, terms->term_good = arg; } else if (!strcmp(arg, "--term-bad") || !strcmp(arg, "--term-new")) { - if (starts_with(argv[++i], "'")) - terms->term_bad = sq_dequote(xstrdup(argv[i])); - else - terms->term_bad = xstrdup(argv[i]); + terms->term_bad = xstrdup(argv[++i]); must_write_terms = 1; } else if (skip_prefix(arg, "--term-bad=", &arg)) { must_write_terms = 1; -- https://github.com/git/git/pull/287