bisect: add git_path_bisect_terms helper

This avoids using the dangerous git_path(). Right now there's only one call site (because the writing half is still part of the shell script), but it may come in handy in the future as more of bisect is written in C. It also matches how we access the other BISECT_* files. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Apr 20, 2017 at 17:08 UTC f5d284f6df5413f1fcdf2c92bbf0e8523298c483
1 file changed +2 -1
bisect.c
+2 -1
@@ -430,6 +430,7 @@ static int read_bisect_refs(void)
430
431 static GIT_PATH_FUNC(git_path_bisect_names, "BISECT_NAMES")
432 static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV")
433 +static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
434
435 static void read_bisect_paths(struct argv_array *array)
436 {
@@ -905,7 +906,7 @@ static void show_diff_tree(const char *prefix, struct commit *commit)
906 void read_bisect_terms(const char **read_bad, const char **read_good)
907 {
908 struct strbuf str = STRBUF_INIT;
908 - const char *filename = git_path("BISECT_TERMS");
909 + const char *filename = git_path_bisect_terms();
910 FILE *fp = fopen(filename, "r");
911
912 if (!fp) {