summaryrefslogtreecommitdiff
path: root/src/path.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-03-24 11:25:59 -0700
committerRussell Belfer <rb@github.com>2014-04-01 09:45:20 -0700
commite402d2f134ff6ac76726bedd37ac4f1c0aa5e9ab (patch)
treefa50df127e8d9cfa5a81f45758b913b8b5e5d4cc /src/path.h
parent8286300a1e2d24dfe184316c0f9798f2c69d0ef4 (diff)
downloadlibgit2-e402d2f134ff6ac76726bedd37ac4f1c0aa5e9ab.tar.gz
Submodule sync refactoring
Turns out there was already a helper to do what I wanted to do, so I just made it so that I could use it for sync and switched to that instead.
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 f26175d15..2367d707b 100644
--- a/src/path.h
+++ b/src/path.h
@@ -119,6 +119,14 @@ GIT_INLINE(void) git_path_mkposix(char *path)
# define git_path_mkposix(p) /* blank */
#endif
+/**
+ * Check if string is a relative path (i.e. starts with "./" or "../")
+ */
+GIT_INLINE(int) git_path_is_relative(const char *p)
+{
+ return (p[0] == '.' && (p[1] == '/' || (p[1] == '.' && p[2] == '/')));
+}
+
extern int git__percent_decode(git_buf *decoded_out, const char *input);
/**