Add support for libgit2 feature detection
This lets us ask the library whether it supports threading, https and ssh.
This commit is contained in:
8
docs/features.rst
Normal file
8
docs/features.rst
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
**********************************************************************
|
||||||
|
Feature detection
|
||||||
|
**********************************************************************
|
||||||
|
|
||||||
|
.. py:data:: pygit2.features
|
||||||
|
|
||||||
|
This variable contains a combination of `GIT_FEATURE_*` flags,
|
||||||
|
indicating which features a particular build of libgit2 supports.
|
@@ -47,6 +47,7 @@ Usage guide:
|
|||||||
remotes
|
remotes
|
||||||
blame
|
blame
|
||||||
settings
|
settings
|
||||||
|
features
|
||||||
|
|
||||||
|
|
||||||
Indices and tables
|
Indices and tables
|
||||||
|
@@ -221,3 +221,8 @@ def clone_into(repo, remote, branch=None):
|
|||||||
check_error(err)
|
check_error(err)
|
||||||
|
|
||||||
settings = Settings()
|
settings = Settings()
|
||||||
|
|
||||||
|
features = C.git_libgit2_features()
|
||||||
|
GIT_FEATURE_THREADS = C.GIT_FEATURE_THREADS
|
||||||
|
GIT_FEATURE_HTTPS = C.GIT_FEATURE_HTTPS
|
||||||
|
GIT_FEATURE_SSH = C.GIT_FEATURE_SSH
|
||||||
|
@@ -74,6 +74,12 @@ typedef struct git_signature {
|
|||||||
git_time when;
|
git_time when;
|
||||||
} git_signature;
|
} git_signature;
|
||||||
|
|
||||||
|
#define GIT_FEATURE_THREADS ...
|
||||||
|
#define GIT_FEATURE_HTTPS ...
|
||||||
|
#define GIT_FEATURE_SSH ...
|
||||||
|
|
||||||
|
int git_libgit2_features(void);
|
||||||
|
|
||||||
const git_error * giterr_last(void);
|
const git_error * giterr_last(void);
|
||||||
|
|
||||||
void git_strarray_free(git_strarray *array);
|
void git_strarray_free(git_strarray *array);
|
||||||
|
Reference in New Issue
Block a user