diff options
| author | Ben Straub <bstraub@github.com> | 2012-07-11 10:10:31 -0700 |
|---|---|---|
| committer | Ben Straub <bstraub@github.com> | 2012-07-11 10:10:31 -0700 |
| commit | c3b5099fe46e1191784cc1890cd35f167305f47a (patch) | |
| tree | 99ba9d21d3ebd34958c4d3b92a3bce54001ed66f /src/clone.c | |
| parent | 822d9dd51f8f2567766c38b719d9d6d5bdc1cfa0 (diff) | |
| download | libgit2-c3b5099fe46e1191784cc1890cd35f167305f47a.tar.gz | |
Add git_path_is_dot_or_dotdot.
Also, remove some duplication in the clone test
suite.
Diffstat (limited to 'src/clone.c')
| -rw-r--r-- | src/clone.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/clone.c b/src/clone.c index 9e527280c..3f161c810 100644 --- a/src/clone.c +++ b/src/clone.c @@ -24,6 +24,7 @@ #include "remote.h" #include "fileops.h" #include "refs.h" +#include "path.h" GIT_BEGIN_DECL @@ -191,13 +192,6 @@ static int setup_remotes_and_fetch(git_repository *repo, } -static bool is_dot_or_dotdot(const char *name) -{ - return (name[0] == '.' && - (name[1] == '\0' || - (name[1] == '.' && name[2] == '\0'))); -} - /* TODO: p_opendir, p_closedir */ static bool path_is_okay(const char *path) { @@ -238,7 +232,7 @@ static bool path_is_okay(const char *path) } while ((e = readdir(dir)) != NULL) { - if (!is_dot_or_dotdot(e->d_name)) { + if (!git_path_is_dot_or_dotdot(e->d_name)) { giterr_set(GITERR_INVALID, "'%s' exists and is not an empty directory", path); retval = false; |
