summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorRomain Geissler <romain.geissler@gmail.com>2011-06-15 12:36:08 +0200
committerRomain Geissler <romain.geissler@gmail.com>2011-06-15 22:11:18 +0200
commit0657e46deef98803058a3c339433a2b6dcafcc13 (patch)
tree58af3fdf2631088e8e9ff7c99bc70558f5f60ca1 /include/git2
parentefcc87c9d95a0b156c657c0e5c11580e7f071efd (diff)
downloadlibgit2-0657e46deef98803058a3c339433a2b6dcafcc13.tar.gz
Fix: GIT_PATH_PATH_SEPARATOR is now a semi-colon under Windows.
GIT_PATH_LIST_SEPARATOR and GIT_PATH_MAX are made public so that it's can be used by a client.
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/common.h20
-rw-r--r--include/git2/repository.h6
2 files changed, 23 insertions, 3 deletions
diff --git a/include/git2/common.h b/include/git2/common.h
index 9a27ac2e5..ba54ce482 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -76,6 +76,10 @@
# define GIT_FORMAT_PRINTF(a,b) /* empty */
#endif
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define GIT_WIN32 1
+#endif
+
/**
* @file git2/common.h
* @brief Git common platform definitions
@@ -86,6 +90,22 @@
GIT_BEGIN_DECL
+/**
+ * The separator used in path list strings (ie like in the PATH
+ * environment variable). A semi-colon ";" is used on Windows, and
+ * a colon ":" for all other systems.
+ */
+#ifdef GIT_WIN32
+#define GIT_PATH_LIST_SEPARATOR ';'
+#else
+#define GIT_PATH_LIST_SEPARATOR ':'
+#endif
+
+/**
+ * The maximum length of a git valid git path.
+ */
+#define GIT_PATH_MAX 4096
+
typedef struct {
char **strings;
size_t count;
diff --git a/include/git2/repository.h b/include/git2/repository.h
index 4a7303e68..baff61d44 100644
--- a/include/git2/repository.h
+++ b/include/git2/repository.h
@@ -151,9 +151,9 @@ GIT_EXTERN(int) git_repository_open3(git_repository **repository,
* @param across_fs If true, then the lookup will not stop when a filesystem device change
* is detected while exploring parent directories.
*
- * @param ceiling_dirs A colon separated of absolute symbolic link free paths. The lookup will
- * stop when any of this paths is reached. Note that the lookup always performs on start_path
- * no matter start_path appears in ceiling_dirs
+ * @param ceiling_dirs A GIT_PATH_LIST_SEPARATOR separated list of absolute symbolic link
+ * free paths. The lookup will stop when any of this paths is reached. Note that the
+ * lookup always performs on start_path no matter start_path appears in ceiling_dirs
* ceiling_dirs might be NULL (which is equivalent to an empty string)
*
* @return 0 on success; error code otherwise