]> git.ipfire.org Git - thirdparty/git.git/blobdiff - bisect.c
Merge branch 'pb/ref-filter-with-crlf'
[thirdparty/git.git] / bisect.c
index d42a3a3767d60bd36af1d57aabd8adc1be5fd378..f5b13681288cc4a677e6531cc57ab0f3ee04b7ac 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -988,8 +988,11 @@ void read_bisect_terms(const char **read_bad, const char **read_good)
  * the bisection process finished successfully.
  * In this case the calling function or command should not turn a
  * BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND return code into an error or a non zero exit code.
- * If no_checkout is non-zero, the bisection process does not
- * checkout the trial commit but instead simply updates BISECT_HEAD.
+ *
+ * Checking BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND
+ * in bisect_helper::bisect_next() and only transforming it to 0 at
+ * the end of bisect_helper::cmd_bisect__helper() helps bypassing
+ * all the code related to finding a commit to test.
  */
 enum bisect_error bisect_next_all(struct repository *r, const char *prefix)
 {
@@ -999,6 +1002,10 @@ enum bisect_error bisect_next_all(struct repository *r, const char *prefix)
        enum bisect_error res = BISECT_OK;
        struct object_id *bisect_rev;
        char *steps_msg;
+       /*
+        * If no_checkout is non-zero, the bisection process does not
+        * checkout the trial commit but instead simply updates BISECT_HEAD.
+        */
        int no_checkout = ref_exists("BISECT_HEAD");
        unsigned bisect_flags = 0;
 
@@ -1082,6 +1089,8 @@ enum bisect_error bisect_next_all(struct repository *r, const char *prefix)
                  "Bisecting: %d revisions left to test after this %s\n",
                  nr), nr, steps_msg);
        free(steps_msg);
+       /* Clean up objects used, as they will be reused. */
+       clear_commit_marks_all(ALL_REV_FLAGS);
 
        return bisect_checkout(bisect_rev, no_checkout);
 }