bisect: no longer try to clean up left-over `.git/head-name` files

As per the code comment, the `.git/head-name` files were cleaned up for backwards-compatibility: an old version of `git bisect` could have left them behind. Now, just how old would such a version be? As of 0f497e75f05 (Eliminate confusing "won't bisect on seeked tree" failure, 2008-02-23), `git bisect` does not write that file anymore. Which corresponds to Git v1.5.4.4. Even if the likelihood is non-nil that there might still be users out there who use such an old version to start a bisection, but then decide to continue bisecting with a current Git version, it is highly improbable. So let's remove that code, at long last. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Jan 12, 2023 at 16:19 UTC de54b5fec45b8e51e94fbe4efbf174f88b38af4e
2 files changed -4
bisect.c
-3
@@ -472,7 +472,6 @@ static GIT_PATH_FUNC(git_path_bisect_start, "BISECT_START")
472 static GIT_PATH_FUNC(git_path_bisect_log, "BISECT_LOG")
473 static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
474 static GIT_PATH_FUNC(git_path_bisect_first_parent, "BISECT_FIRST_PARENT")
475 -static GIT_PATH_FUNC(git_path_head_name, "head-name")
475
476 static void read_bisect_paths(struct strvec *array)
477 {
@@ -1188,8 +1187,6 @@ int bisect_clean_state(void)
1187 unlink_or_warn(git_path_bisect_run());
1188 unlink_or_warn(git_path_bisect_terms());
1189 unlink_or_warn(git_path_bisect_first_parent());
1191 - /* Cleanup head-name if it got left by an old version of git-bisect */
1192 - unlink_or_warn(git_path_head_name());
1190 /*
1191 * Cleanup BISECT_START last to support the --no-checkout option
1192 * introduced in the commit 4796e823a.
t/t6030-bisect-porcelain.sh
-1
@@ -1158,7 +1158,6 @@ test_expect_success 'git bisect reset cleans bisection state properly' '
1158 test_path_is_missing ".git/BISECT_LOG" &&
1159 test_path_is_missing ".git/BISECT_RUN" &&
1160 test_path_is_missing ".git/BISECT_TERMS" &&
1161 - test_path_is_missing ".git/head-name" &&
1161 test_path_is_missing ".git/BISECT_HEAD" &&
1162 test_path_is_missing ".git/BISECT_START"
1163 '