summaryrefslogtreecommitdiff
path: root/features.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2017-01-20 22:55:25 +0000
committerGitHub <[email protected]>2017-01-20 22:55:25 +0000
commit4a14260153072e1e0d8e32d9270b30e3acca7c80 (patch)
tree112c3a1f75c2fcc8d3e88f1d0c6687de179e3ac3 /features.go
parentb8a9efd21f5ea094976ff2c53c4aec1cf6014876 (diff)
parentb020c1140a2cb8be18141498a6cab5440409dc24 (diff)
Merge pull request #362 from libgit2/cmn/master-tip-static
Update master to latest libgit2 and build statically
Diffstat (limited to 'features.go')
-rw-r--r--features.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/features.go b/features.go
new file mode 100644
index 0000000..f6474a0
--- /dev/null
+++ b/features.go
@@ -0,0 +1,30 @@
+package git
+
+/*
+#include <git2.h>
+*/
+import "C"
+
+type Feature int
+
+const (
+ // libgit2 was built with threading support
+ FeatureThreads Feature = C.GIT_FEATURE_THREADS
+
+ // libgit2 was built with HTTPS support built-in
+ FeatureHttps Feature = C.GIT_FEATURE_HTTPS
+
+ // libgit2 was build with SSH support built-in
+ FeatureSsh Feature = C.GIT_FEATURE_SSH
+
+ // libgit2 was built with nanosecond support for files
+ FeatureNSec Feature = C.GIT_FEATURE_NSEC
+)
+
+// Features returns a bit-flag of Feature values indicating which features the
+// loaded libgit2 library has.
+func Features() Feature {
+ features := C.git_libgit2_features()
+
+ return Feature(features)
+}