Skip to content

Commit f5d284f

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 49800c9 commit f5d284f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bisect.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ static int read_bisect_refs(void)
430430

431431
static GIT_PATH_FUNC(git_path_bisect_names, "BISECT_NAMES")
432432
static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV")
433+
static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
433434

434435
static void read_bisect_paths(struct argv_array *array)
435436
{
@@ -905,7 +906,7 @@ static void show_diff_tree(const char *prefix, struct commit *commit)
905906
void read_bisect_terms(const char **read_bad, const char **read_good)
906907
{
907908
struct strbuf str = STRBUF_INIT;
908-
const char *filename = git_path("BISECT_TERMS");
909+
const char *filename = git_path_bisect_terms();
909910
FILE *fp = fopen(filename, "r");
910911

911912
if (!fp) {

0 commit comments

Comments
 (0)