summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2008-12-31 16:07:38 -0800
committerShawn O. Pearce <spearce@spearce.org>2008-12-31 16:07:38 -0800
commit7350e6337a2d94c2d2a105845fc78ba0ddc89ea5 (patch)
tree5152c60f1d88042a52d66344b1d628d2465fef6c /src/fileops.c
parent2c4b7707f7e1d591ec1765ab7057a03283841c3e (diff)
downloadlibgit2-7350e6337a2d94c2d2a105845fc78ba0ddc89ea5.tar.gz
Define gitfo_exists to determine file presence
When scanning the pack directory we need to see if the path name is present for ".idx" when we discover a ".pack" file. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/fileops.c b/src/fileops.c
index 0867c7b57..16b9dc520 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -53,6 +53,12 @@ int gitfo_write(git_file fd, void *buf, size_t cnt)
return GIT_SUCCESS;
}
+int gitfo_exists(const char *path)
+{
+ struct stat sb;
+ return stat(path, &sb);
+}
+
off_t gitfo_size(git_file fd)
{
struct stat sb;