use git_path_* helper functions

Long ago we added functions like git_path_merge_msg() to
replace the more dangerous git_path("MERGE_MSG"). Over time
some new calls to the latter have crept it. Let's convert
them to use the safer form.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2017-04-20 17:08:54 -04:00
committed by Junio C Hamano
parent c10388c7dc
commit ca03e0670c
3 changed files with 11 additions and 11 deletions

View File

@ -332,7 +332,7 @@ static int git_pull_config(const char *var, const char *value, void *cb)
*/
static void get_merge_heads(struct sha1_array *merge_heads)
{
const char *filename = git_path("FETCH_HEAD");
const char *filename = git_path_fetch_head();
FILE *fp;
struct strbuf sb = STRBUF_INIT;
unsigned char sha1[GIT_SHA1_RAWSZ];
@ -791,7 +791,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
if (read_cache_unmerged())
die_resolve_conflict("pull");
if (file_exists(git_path("MERGE_HEAD")))
if (file_exists(git_path_merge_head()))
die_conclude_merge();
if (get_sha1("HEAD", orig_head))