Skip to content

Commit cc71058

Browse files
pranitbauva1997gitster
authored andcommitted
bisect--helper: remove the dequote in bisect_start()
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 <[email protected]> Mentored-by: Christian Couder <[email protected]> Signed-off-by: Pranit Bauva <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9650eab commit cc71058

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

builtin/bisect--helper.c

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -561,36 +561,25 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,
561561
no_checkout = 1;
562562

563563
for (i = 0; i < argc; i++) {
564-
const char *arg;
565-
if (starts_with(argv[i], "'"))
566-
arg = sq_dequote(xstrdup(argv[i]));
567-
else
568-
arg = argv[i];
569-
if (!strcmp(arg, "--")) {
564+
if (!strcmp(argv[i], "--")) {
570565
has_double_dash = 1;
571566
break;
572567
}
573568
}
574569

575570
for (i = 0; i < argc; i++) {
576-
const char *arg, *commit_id;
577-
if (starts_with(argv[i], "'"))
578-
arg = sq_dequote(xstrdup(argv[i]));
579-
else
580-
arg = argv[i];
581-
commit_id = xstrfmt("%s^{commit}", arg);
571+
const char *commit_id;
572+
const char *arg = argv[i];
573+
commit_id = xstrfmt("%s^{commit}", argv[i]);
582574
if (!strcmp(argv[i], "--")) {
583575
has_double_dash = 1;
584576
break;
585577
} else if (!strcmp(arg, "--no-checkout")) {
586578
no_checkout = 1;
587579
} else if (!strcmp(arg, "--term-good") ||
588580
!strcmp(arg, "--term-old")) {
589-
if (starts_with(argv[++i], "'"))
590-
terms->term_good = sq_dequote(xstrdup(argv[i]));
591-
else
592-
terms->term_good = xstrdup(argv[i]);
593581
must_write_terms = 1;
582+
terms->term_good = xstrdup(argv[++i]);
594583
} else if (skip_prefix(arg, "--term-good=", &arg)) {
595584
must_write_terms = 1;
596585
terms->term_good = arg;
@@ -599,10 +588,7 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,
599588
terms->term_good = arg;
600589
} else if (!strcmp(arg, "--term-bad") ||
601590
!strcmp(arg, "--term-new")) {
602-
if (starts_with(argv[++i], "'"))
603-
terms->term_bad = sq_dequote(xstrdup(argv[i]));
604-
else
605-
terms->term_bad = xstrdup(argv[i]);
591+
terms->term_bad = xstrdup(argv[++i]);
606592
must_write_terms = 1;
607593
} else if (skip_prefix(arg, "--term-bad=", &arg)) {
608594
must_write_terms = 1;

0 commit comments

Comments
 (0)