bisect--helper: retire `--check-expected-revs` subcommand
The `--check-expected-revs` subcommand is no longer used from the git-bisect.sh shell script. Functions `check_expected_revs` and `is_expected_revs` are also deleted. Mentored-by: Lars Schneider <larsxschneider@gmail.com> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Mentored-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com> Signed-off-by: Tanushree Tumane <tanushreetumane@gmail.com> Signed-off-by: Miriam Rubio <mirucam@gmail.com> Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Pranit Bauva committed
Oct 15, 2020 at 15:38 UTC
9b437b056d9b4c8c99fb1e9dfa0ad06072e2ab0f
1 file changed
-30
builtin/bisect--helper.c
-30
@@ -187,30 +187,6 @@ static int write_terms(const char *bad, const char *good)
187
return res;
188
}
189
190
-static int is_expected_rev(const char *expected_hex)
191
-{
192
- struct strbuf actual_hex = STRBUF_INIT;
193
- int res = 0;
194
- if (strbuf_read_file(&actual_hex, git_path_bisect_expected_rev(), 0) >= 40) {
195
- strbuf_trim(&actual_hex);
196
- res = !strcmp(actual_hex.buf, expected_hex);
197
- }
198
- strbuf_release(&actual_hex);
199
- return res;
200
-}
201
-
202
-static void check_expected_revs(const char **revs, int rev_nr)
203
-{
204
- int i;
205
-
206
- for (i = 0; i < rev_nr; i++) {
207
- if (!is_expected_rev(revs[i])) {
208
- unlink_or_warn(git_path_bisect_ancestors_ok());
209
- unlink_or_warn(git_path_bisect_expected_rev());
210
- }
211
- }
212
-}
213
-
190
static int bisect_reset(const char *commit)
191
{
192
struct strbuf branch = STRBUF_INIT;
@@ -935,7 +911,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
911
{
912
enum {
913
WRITE_TERMS = 1,
938
- CHECK_EXPECTED_REVS,
914
BISECT_RESET,
915
BISECT_WRITE,
916
CHECK_AND_SET_TERMS,
@@ -951,8 +926,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
926
struct option options[] = {
927
OPT_CMDMODE(0, "write-terms", &cmdmode,
928
N_("write the terms to .git/BISECT_TERMS"), WRITE_TERMS),
954
- OPT_CMDMODE(0, "check-expected-revs", &cmdmode,
955
- N_("check for expected revs"), CHECK_EXPECTED_REVS),
929
OPT_CMDMODE(0, "bisect-reset", &cmdmode,
930
N_("reset the bisection state"), BISECT_RESET),
931
OPT_CMDMODE(0, "bisect-write", &cmdmode,
@@ -991,9 +964,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
964
if (argc != 2)
965
return error(_("--write-terms requires two arguments"));
966
return write_terms(argv[0], argv[1]);
994
- case CHECK_EXPECTED_REVS:
995
- check_expected_revs(argv, argc);
996
- return 0;
967
case BISECT_RESET:
968
if (argc > 1)
969
return error(_("--bisect-reset requires either no argument or a commit"));