diff options
author | Vicent Marti <tanoku@gmail.com> | 2010-11-02 18:42:42 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2010-11-02 18:42:42 +0200 |
commit | 6fd195d76c7f52baae5540e287affe2259900d36 (patch) | |
tree | 4dd644c5086dce17827f42b8c811049175da88f9 /src/fileops.c | |
parent | d80e9d55aa2d0629f7f207db42762494075d7854 (diff) | |
download | libgit2-6fd195d76c7f52baae5540e287affe2259900d36.tar.gz |
Change git_repository initialization to use a path
The constructor to git_repository is now called
'git_repository_open(path)'
and takes a path to a git repository instead of an existing ODB object.
Unit tests have been updated accordingly and the two test repositories
have been merged into one.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/fileops.c')
-rw-r--r-- | src/fileops.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fileops.c b/src/fileops.c index f101cec32..e0a5ff461 100644 --- a/src/fileops.c +++ b/src/fileops.c @@ -53,6 +53,13 @@ int gitfo_write(git_file fd, void *buf, size_t cnt) return GIT_SUCCESS; } +int gitfo_isdir(const char *path) +{ + struct stat st; + return (path && gitfo_stat(path, &st) == 0 && S_ISDIR(st.st_mode)) ? + GIT_SUCCESS : GIT_ENOTFOUND; +} + int gitfo_exists(const char *path) { return access(path, F_OK); |