diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-09-14 11:53:53 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-14 11:53:53 -0700 |
commit | 8c11b25de41857e5a44325046dd55d3751f740c6 (patch) | |
tree | 066d739a7361b0341b84ad19ad0d62ad04c1f366 /builtin/clone.c | |
parent | 0ca416f166df7e96d9115a1fe213720f09a1417b (diff) | |
parent | 4e2d094dde4f078245d057dd6111ab9d013ae6d0 (diff) | |
download | git-8c11b25de41857e5a44325046dd55d3751f740c6.tar.gz git-8c11b25de41857e5a44325046dd55d3751f740c6.tar.xz |
Merge branch 'rj/path-cleanup'
* rj/path-cleanup:
Call mkpathdup() rather than xstrdup(mkpath(...))
Call git_pathdup() rather than xstrdup(git_path("..."))
path.c: Use vsnpath() in the implementation of git_path()
path.c: Don't discard the return value of vsnpath()
path.c: Remove the 'git_' prefix from a file scope function
Diffstat (limited to 'builtin/clone.c')
-rw-r--r-- | builtin/clone.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index 5e8f3ba22..5a9b2bce2 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -236,7 +236,7 @@ static int add_one_reference(struct string_list_item *item, void *cb_data) /* Beware: real_path() and mkpath() return static buffer */ ref_git = xstrdup(real_path(item->string)); if (is_directory(mkpath("%s/.git/objects", ref_git))) { - char *ref_git_git = xstrdup(mkpath("%s/.git", ref_git)); + char *ref_git_git = mkpathdup("%s/.git", ref_git); free(ref_git); ref_git = ref_git_git; } else if (!is_directory(mkpath("%s/objects", ref_git))) @@ -700,7 +700,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) git_dir = xstrdup(dir); else { work_tree = dir; - git_dir = xstrdup(mkpath("%s/.git", dir)); + git_dir = mkpathdup("%s/.git", dir); } if (!option_bare) { |