summaryrefslogtreecommitdiff
path: root/builtin-clone.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2008-09-25 16:39:24 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2008-09-25 16:39:24 (GMT)
commit1ad6d46235d135582d5cbb91ec0186b485c7b5c1 (patch)
treee4a98d08b88862305d9f13ccef82180de33e8bcc /builtin-clone.c
parent6ef1daf77202aee71056771d91dd12121c6061fd (diff)
parentd79796bcf05b89774671a75b3285000c43129823 (diff)
downloadgit-1ad6d46235d135582d5cbb91ec0186b485c7b5c1.zip
git-1ad6d46235d135582d5cbb91ec0186b485c7b5c1.tar.gz
git-1ad6d46235d135582d5cbb91ec0186b485c7b5c1.tar.bz2
Merge branch 'jc/alternate-push'
* jc/alternate-push: push: receiver end advertises refs from alternate repositories push: prepare sender to receive extended ref information from the receiver receive-pack: make it a builtin is_directory(): a generic helper function
Diffstat (limited to 'builtin-clone.c')
-rw-r--r--builtin-clone.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/builtin-clone.c b/builtin-clone.c
index 5b40e07..49d2eb9 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -77,7 +77,7 @@ static char *get_repo_path(const char *repo, int *is_bundle)
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));
}
@@ -140,13 +140,6 @@ static char *guess_dir_name(const char *repo, int is_bundle, int is_bare)
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);