diff options
author | Russell Belfer <rb@github.com> | 2014-03-24 11:25:59 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-04-01 09:45:20 -0700 |
commit | e402d2f134ff6ac76726bedd37ac4f1c0aa5e9ab (patch) | |
tree | fa50df127e8d9cfa5a81f45758b913b8b5e5d4cc /src/path.h | |
parent | 8286300a1e2d24dfe184316c0f9798f2c69d0ef4 (diff) | |
download | libgit2-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.h | 8 |
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); /** |