diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-12-01 09:04:29 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-12-01 09:04:30 -0800 |
commit | dfc03e48ec2b48e6af6b5eb35820b1e435f59066 (patch) | |
tree | 4c037c7b3e78e1fd1b0f3067c4f410450a16a8a4 /builtin/clone.c | |
parent | Merge branch 'ma/bisect-doc-sample-update' (diff) | |
parent | clone: rename static function `dir_exists()`. (diff) | |
download | tgif-dfc03e48ec2b48e6af6b5eb35820b1e435f59066.tar.xz |
Merge branch 'mr/clone-dir-exists-to-path-exists'
Code cleanup.
* mr/clone-dir-exists-to-path-exists:
clone: rename static function `dir_exists()`.
Diffstat (limited to 'builtin/clone.c')
-rw-r--r-- | builtin/clone.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index c46ee29f0a..b24f04cf33 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -899,7 +899,7 @@ static void dissociate_from_references(void) free(alternates); } -static int dir_exists(const char *path) +static int path_exists(const char *path) { struct stat sb; return !stat(path, &sb); @@ -981,7 +981,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) dir = guess_dir_name(repo_name, is_bundle, option_bare); strip_trailing_slashes(dir); - dest_exists = dir_exists(dir); + dest_exists = path_exists(dir); if (dest_exists && !is_empty_dir(dir)) die(_("destination path '%s' already exists and is not " "an empty directory."), dir); @@ -992,7 +992,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) work_tree = NULL; else { work_tree = getenv("GIT_WORK_TREE"); - if (work_tree && dir_exists(work_tree)) + if (work_tree && path_exists(work_tree)) die(_("working tree '%s' already exists."), work_tree); } @@ -1020,7 +1020,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) } if (real_git_dir) { - if (dir_exists(real_git_dir)) + if (path_exists(real_git_dir)) junk_git_dir_flags |= REMOVE_DIR_KEEP_TOPLEVEL; junk_git_dir = real_git_dir; } else { |