diff --git a/builtin-clone.c b/builtin-clone.c
index 5b40e07ba7f13950078d36a48c2cb3f6e6c3c2c4..49d2eb9c2ba574f2c1484717f0755208e7ed8147 100644 (file)
--- a/builtin-clone.c
+++ b/builtin-clone.c
for (i = 0; i < ARRAY_SIZE(suffix); i++) {
const char *path;
path = mkpath("%s%s", repo, suffix[i]);
- if (!stat(path, &st) && S_ISDIR(st.st_mode)) {
+ if (is_directory(path)) {
*is_bundle = 0;
return xstrdup(make_nonrelative_path(path));
}
return xstrndup(start, end - start);
}
-static int is_directory(const char *path)
-{
- struct stat buf;
-
- return !stat(path, &buf) && S_ISDIR(buf.st_mode);
-}
-
static void strip_trailing_slashes(char *dir)
{
char *end = dir + strlen(dir);