summaryrefslogtreecommitdiff
path: root/features.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2017-01-20 00:46:34 +0000
committerCarlos Martín Nieto <[email protected]>2017-01-20 00:46:34 +0000
commitf0370741989f40b597c99e6093ce7fa0b1983397 (patch)
treef4124f42d79403e0ef20af1080ac3818604ce49c /features.go
parentb8a9efd21f5ea094976ff2c53c4aec1cf6014876 (diff)
parent5d0a4c752a74258a5f42e40fccd2908ac4e336b8 (diff)
Merge remote-tracking branch 'origin/next'
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)
+}