Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for libgit2 feature detection #475

Merged
merged 1 commit into from
Jan 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/features.rst
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Usage guide:
remotes
blame
settings
features


Indices and tables
Expand Down
5 changes: 5 additions & 0 deletions pygit2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,8 @@ def clone_into(repo, remote, branch=None):
check_error(err)

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
6 changes: 6 additions & 0 deletions pygit2/decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ typedef struct git_signature {
git_time when;
} 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);

void git_strarray_free(git_strarray *array);
Expand Down