git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Subject: [PATCH 1/6] bisect: add git_path_bisect_terms helper
Date: Thu, 20 Apr 2017 17:08:25 -0400	[thread overview]
Message-ID: <20170420210825.lr55sl7se4uloncf@sigill.intra.peff.net> (raw)
In-Reply-To: <20170420210754.bzrnc74dpjs7fgpf@sigill.intra.peff.net>

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>
---
 bisect.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bisect.c b/bisect.c
index 03af06c66..08c9fb726 100644
--- a/bisect.c
+++ b/bisect.c
@@ -432,6 +432,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)
 {
@@ -906,7 +907,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) {
-- 
2.13.0.rc0.363.g8726c260e


  reply	other threads:[~2017-04-20 21:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 21:07 [PATCH 0/6] removing more calls to git_path() Jeff King
2017-04-20 21:08 ` Jeff King [this message]
2017-04-20 21:08 ` [PATCH 2/6] branch: add edit_description() helper Jeff King
2017-04-20 21:08 ` [PATCH 3/6] use git_path_* helper functions Jeff King
2017-04-20 21:09 ` [PATCH 4/6] replace xstrdup(git_path(...)) with git_pathdup(...) Jeff King
2017-04-20 21:09 ` [PATCH 5/6] replace strbuf_addstr(git_path()) with git_path_buf() Jeff King
2017-04-20 21:09 ` [PATCH 6/6] am: drop "dir" parameter from am_state_init Jeff King
2017-04-21  4:05 ` [PATCH 0/6] removing more calls to git_path() Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170420210825.lr55sl7se4uloncf@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).