summaryrefslogtreecommitdiff
path: root/src/path.h
diff options
context:
space:
mode:
authorBen Straub <bstraub@github.com>2012-07-11 10:10:31 -0700
committerBen Straub <bstraub@github.com>2012-07-11 10:10:31 -0700
commitc3b5099fe46e1191784cc1890cd35f167305f47a (patch)
tree99ba9d21d3ebd34958c4d3b92a3bce54001ed66f /src/path.h
parent822d9dd51f8f2567766c38b719d9d6d5bdc1cfa0 (diff)
downloadlibgit2-c3b5099fe46e1191784cc1890cd35f167305f47a.tar.gz
Add git_path_is_dot_or_dotdot.
Also, remove some duplication in the clone test suite.
Diffstat (limited to 'src/path.h')
-rw-r--r--src/path.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/path.h b/src/path.h
index fd76805e5..76e01fc8f 100644
--- a/src/path.h
+++ b/src/path.h
@@ -80,6 +80,14 @@ extern int git_path_to_dir(git_buf *path);
*/
extern void git_path_string_to_dir(char* path, size_t size);
+/* Taken from git.git */
+GIT_INLINE(int) git_path_is_dot_or_dotdot(const char *name)
+{
+ return (name[0] == '.' &&
+ (name[1] == '\0' ||
+ (name[1] == '.' && name[2] == '\0')));
+}
+
#ifdef GIT_WIN32
/**
* Convert backslashes in path to forward slashes.