Skip to content

Commit dfc03e4

Browse files
committed
Merge branch 'mr/clone-dir-exists-to-path-exists'
Code cleanup. * mr/clone-dir-exists-to-path-exists: clone: rename static function `dir_exists()`.
2 parents fac9ab1 + 6c02042 commit dfc03e4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builtin/clone.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ static void dissociate_from_references(void)
899899
free(alternates);
900900
}
901901

902-
static int dir_exists(const char *path)
902+
static int path_exists(const char *path)
903903
{
904904
struct stat sb;
905905
return !stat(path, &sb);
@@ -981,7 +981,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
981981
dir = guess_dir_name(repo_name, is_bundle, option_bare);
982982
strip_trailing_slashes(dir);
983983

984-
dest_exists = dir_exists(dir);
984+
dest_exists = path_exists(dir);
985985
if (dest_exists && !is_empty_dir(dir))
986986
die(_("destination path '%s' already exists and is not "
987987
"an empty directory."), dir);
@@ -992,7 +992,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
992992
work_tree = NULL;
993993
else {
994994
work_tree = getenv("GIT_WORK_TREE");
995-
if (work_tree && dir_exists(work_tree))
995+
if (work_tree && path_exists(work_tree))
996996
die(_("working tree '%s' already exists."), work_tree);
997997
}
998998

@@ -1020,7 +1020,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
10201020
}
10211021

10221022
if (real_git_dir) {
1023-
if (dir_exists(real_git_dir))
1023+
if (path_exists(real_git_dir))
10241024
junk_git_dir_flags |= REMOVE_DIR_KEEP_TOPLEVEL;
10251025
junk_git_dir = real_git_dir;
10261026
} else {

0 commit comments

Comments
 (0)