From: Junio C Hamano Date: Thu, 30 Jul 2026 17:44:41 +0000 (-0700) Subject: Merge branch 'hn/bisect-reset-when-found' into seen X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=892f28c86c845038604d9d18a9c3c5d97006898c;p=thirdparty%2Fgit.git Merge branch 'hn/bisect-reset-when-found' into seen The 'git bisect' command has been taught a '--reset-when-found[=]' option that tells the command to automatically run 'git bisect reset' to jump back to the original state or to the found culprit. * hn/bisect-reset-when-found: bisect: add --reset-when-found to leave when done bisect: let bisect_reset() optionally check out quietly --- 892f28c86c845038604d9d18a9c3c5d97006898c diff --cc builtin/bisect.c index 30883fea9c,de13f22f8a..c49b1b911e --- a/builtin/bisect.c +++ b/builtin/bisect.c @@@ -1315,14 -1404,9 +1419,14 @@@ static int bisect_run(struct bisect_ter fflush(stdout); saved_stdout = dup(1); + if (saved_stdout < 0) { + res = error_errno(_("could not duplicate stdout")); + close(temporary_stdout_fd); + break; + } dup2(temporary_stdout_fd, 1); - res = bisect_state(terms, 1, &new_state); + res = bisect_state(terms, 1, &new_state, true); fflush(stdout); dup2(saved_stdout, 1); @@@ -1397,9 -1485,7 +1505,9 @@@ static int cmd_bisect__next(int argc, c return error(_("'%s' requires 0 arguments"), "git bisect next"); get_terms(&terms); + if (!terms.term_bad || !terms.term_good) + return error(_("no terms defined")); - res = bisect_next(&terms, prefix); + res = bisect_next(&terms, prefix, false); free_terms(&terms); return res; }