summaryrefslogtreecommitdiff
path: root/bisect.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-04-20 21:08:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-21 04:03:06 (GMT)
commitf5d284f6df5413f1fcdf2c92bbf0e8523298c483 (patch)
tree36ea5dd9df53a0ea074ef5db52b21219aa50c28a /bisect.c
parent49800c940790cc7465d1b03e08d472ffd8684808 (diff)
downloadgit-f5d284f6df5413f1fcdf2c92bbf0e8523298c483.zip
git-f5d284f6df5413f1fcdf2c92bbf0e8523298c483.tar.gz
git-f5d284f6df5413f1fcdf2c92bbf0e8523298c483.tar.bz2
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>
Diffstat (limited to 'bisect.c')
-rw-r--r--bisect.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bisect.c b/bisect.c
index 30808ca..fb9c9b1 100644
--- a/bisect.c
+++ b/bisect.c
@@ -430,6 +430,7 @@ static int read_bisect_refs(void)
static GIT_PATH_FUNC(git_path_bisect_names, "BISECT_NAMES")
static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV")
+static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
static void read_bisect_paths(struct argv_array *array)
{
@@ -905,7 +906,7 @@ static void show_diff_tree(const char *prefix, struct commit *commit)
void read_bisect_terms(const char **read_bad, const char **read_good)
{
struct strbuf str = STRBUF_INIT;
- const char *filename = git_path("BISECT_TERMS");
+ const char *filename = git_path_bisect_terms();
FILE *fp = fopen(filename, "r");
if (!fp) {