Commit 4d503f884a241c507ec4e474e3e3463c2e394d52

Ramsay Jones 2009-06-04T16:48:53

gitfo_exists: replace call to stat() with access() Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Andreas Ericsson <ae@op5.se>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/fileops.c b/src/fileops.c
index 09e1e12..581dc35 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -55,8 +55,7 @@ int gitfo_write(git_file fd, void *buf, size_t cnt)
 
 int gitfo_exists(const char *path)
 {
-	struct stat sb;
-	return stat(path, &sb);
+	return access(path, F_OK);
 }
 
 off_t gitfo_size(git_file fd)