replace xstrdup(git_path(...)) with git_pathdup(...)

It's more efficient to use git_pathdup(), as it skips an
extra copy of the path. And by removing some calls to
git_path(), it makes it easier to audit for dangerous uses.

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:09:09 -04:00
committed by Junio C Hamano
parent ca03e0670c
commit d9c69644b2
2 changed files with 4 additions and 3 deletions

View File

@ -3203,7 +3203,7 @@ static char* make_fast_import_path(const char *path)
{
if (!relative_marks_paths || is_absolute_path(path))
return xstrdup(path);
return xstrdup(git_path("info/fast-import/%s", path));
return git_pathdup("info/fast-import/%s", path);
}
static void option_import_marks(const char *marks,