summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-12-20 15:28:46 +0000
committerGitHub <noreply@github.com>2016-12-20 15:28:46 +0000
commitf91f170f0e334963473a0f1060d2b07fbe63abbf (patch)
tree570210690c8e602eef19d35e2c3ac9a6ef9e74d6
parent329ce0439b38c03d2b887f1d12b8914a77c038e1 (diff)
parent77e4623257dbdabb98e7ed5812ae4a8614c815b6 (diff)
downloadlibgit2-f91f170f0e334963473a0f1060d2b07fbe63abbf.tar.gz
Merge pull request #4032 from libgit2/cmn/https-cap-no-hardcode
Don't hard-code HTTPS cap & clarify the meanings of the features enum
-rw-r--r--include/git2/common.h18
-rw-r--r--src/settings.c2
2 files changed, 20 insertions, 0 deletions
diff --git a/include/git2/common.h b/include/git2/common.h
index a8d698fa4..99c99812b 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -109,9 +109,27 @@ GIT_EXTERN(void) git_libgit2_version(int *major, int *minor, int *rev);
* was compiled
*/
typedef enum {
+ /**
+ * If set, libgit2 was built thread-aware and can be safely used from multiple
+ * threads.
+ */
GIT_FEATURE_THREADS = (1 << 0),
+ /**
+ * If set, libgit2 was built with and linked against a TLS implementation.
+ * Custom TLS streams may still be added by the user to support HTTPS
+ * regardless of this.
+ */
GIT_FEATURE_HTTPS = (1 << 1),
+ /**
+ * If set, libgit2 was built with and linked against libssh2. A custom
+ * transport may still be added by the user to support libssh2 regardless of
+ * this.
+ */
GIT_FEATURE_SSH = (1 << 2),
+ /**
+ * If set, libgit2 was built with support for sub-second resolution in file
+ * modification times.
+ */
GIT_FEATURE_NSEC = (1 << 3),
} git_feature_t;
diff --git a/src/settings.c b/src/settings.c
index cb2317f74..4a6e0f353 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -29,7 +29,9 @@ int git_libgit2_features(void)
#ifdef GIT_THREADS
| GIT_FEATURE_THREADS
#endif
+#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT)
| GIT_FEATURE_HTTPS
+#endif
#if defined(GIT_SSH)
| GIT_FEATURE_SSH
#endif