summaryrefslogtreecommitdiff
path: root/src/posix.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-07-31 17:02:54 -0700
committerRussell Belfer <rb@github.com>2012-08-22 16:07:19 -0700
commitca1b6e54095a7e28d468a832f143025feae6cd4f (patch)
tree0ff9b9fbf71cd4f0489985b64f57590687361cd2 /src/posix.h
parent662880ca60e4d1662bb10648522242ac54797720 (diff)
downloadlibgit2-ca1b6e54095a7e28d468a832f143025feae6cd4f.tar.gz
Add template dir and set gid to repo init
This extends git_repository_init_ext further with support for initializing the repository from an external template directory and with support for the "create shared" type flags that make a set GID repository directory. This also adds tests for much of the new functionality to the existing `repo/init.c` test suite. Also, this adds a bunch of new utility functions including a very general purpose `git_futils_mkdir` (with the ability to make paths and to chmod the paths post-creation) and a file tree copying function `git_futils_cp_r`. Also, this includes some new path functions that were useful to keep the code simple.
Diffstat (limited to 'src/posix.h')
-rw-r--r--src/posix.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/posix.h b/src/posix.h
index d35fe08a5..71bb82283 100644
--- a/src/posix.h
+++ b/src/posix.h
@@ -11,8 +11,15 @@
#include <fcntl.h>
#include <time.h>
+#ifndef S_IFGITLINK
#define S_IFGITLINK 0160000
#define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK)
+#endif
+
+/* if S_ISGID is not defined, then don't try to set it */
+#ifndef S_ISGID
+#define S_ISGID 0
+#endif
#if !defined(O_BINARY)
#define O_BINARY 0