aboutsummaryrefslogtreecommitdiff
path: root/bisect.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-19 14:48:56 -0700
committerJunio C Hamano <gitster@pobox.com>2015-08-19 14:48:56 -0700
commit8c9155e031869293b99531a25b585e49f74beaba (patch)
tree4ed3a2872b4011806c28a0c38cf977a4de68a51e /bisect.c
parent51a22ce1477b991793c20d3143d72f0ae6e38c76 (diff)
parentf932729cc7707390f4d6739be1573e93ceb9df22 (diff)
downloadgit-8c9155e031869293b99531a25b585e49f74beaba.tar.gz
git-8c9155e031869293b99531a25b585e49f74beaba.tar.xz
Merge branch 'jk/git-path'
git_path() and mkpath() are handy helper functions but it is easy to misuse, as the callers need to be careful to keep the number of active results below 4. Their uses have been reduced. * jk/git-path: memoize common git-path "constant" files get_repo_path: refactor path-allocation find_hook: keep our own static buffer refs.c: remove_empty_directories can take a strbuf refs.c: avoid git_path assignment in lock_ref_sha1_basic refs.c: avoid repeated git_path calls in rename_tmp_log refs.c: simplify strbufs in reflog setup and writing path.c: drop git_path_submodule refs.c: remove extra git_path calls from read_loose_refs remote.c: drop extraneous local variable from migrate_file prefer mkpathdup to mkpath in assignments prefer git_pathdup to git_path in some possibly-dangerous cases add_to_alternates_file: don't add duplicate entries t5700: modernize style cache.h: complete set of git_path_submodule helpers cache.h: clarify documentation for git_path, et al
Diffstat (limited to 'bisect.c')
-rw-r--r--bisect.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bisect.c b/bisect.c
index 857cf59aa..f9da9d134 100644
--- a/bisect.c
+++ b/bisect.c
@@ -429,10 +429,13 @@ static int read_bisect_refs(void)
return for_each_ref_in("refs/bisect/", register_ref, NULL);
}
+static GIT_PATH_FUNC(git_path_bisect_names, "BISECT_NAMES")
+static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV")
+
static void read_bisect_paths(struct argv_array *array)
{
struct strbuf str = STRBUF_INIT;
- const char *filename = git_path("BISECT_NAMES");
+ const char *filename = git_path_bisect_names();
FILE *fp = fopen(filename, "r");
if (!fp)
@@ -653,7 +656,7 @@ static void exit_if_skipped_commits(struct commit_list *tried,
static int is_expected_rev(const struct object_id *oid)
{
- const char *filename = git_path("BISECT_EXPECTED_REV");
+ const char *filename = git_path_bisect_expected_rev();
struct stat st;
struct strbuf str = STRBUF_INIT;
FILE *fp;