Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
f34b9a59
Commit
f34b9a59
authored
Mar 03, 2014
by
Vicent Marti
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2150 from libgit2/vmg/features
caps: Rename to features to avoid confusion
parents
494be429
ebb3c506
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
21 deletions
+26
-21
include/git2/common.h
+14
-9
src/settings.c
+4
-4
tests/core/features.c
+8
-8
No files found.
include/git2/common.h
View file @
f34b9a59
...
...
@@ -94,29 +94,34 @@ GIT_BEGIN_DECL
GIT_EXTERN
(
void
)
git_libgit2_version
(
int
*
major
,
int
*
minor
,
int
*
rev
);
/**
* Combinations of these values describe the capabilities of libgit2.
* Combinations of these values describe the features with which libgit2
* was compiled
*/
typedef
enum
{
GIT_
CAP_THREADS
=
(
1
<<
0
),
GIT_
CAP_HTTPS
=
(
1
<<
1
),
GIT_
CAP_SSH
=
(
1
<<
2
),
}
git_
cap
_t
;
GIT_
FEATURE_THREADS
=
(
1
<<
0
),
GIT_
FEATURE_HTTPS
=
(
1
<<
1
),
GIT_
FEATURE_SSH
=
(
1
<<
2
),
}
git_
feature
_t
;
/**
* Query compile time options for libgit2.
*
* @return A combination of GIT_
CAP
_* values.
* @return A combination of GIT_
FEATURE
_* values.
*
* - GIT_
CAP
_THREADS
* - GIT_
FEATURE
_THREADS
* Libgit2 was compiled with thread support. Note that thread support is
* still to be seen as a 'work in progress' - basic object lookups are
* believed to be threadsafe, but other operations may not be.
*
* - GIT_
CAP
_HTTPS
* - GIT_
FEATURE
_HTTPS
* Libgit2 supports the https:// protocol. This requires the openssl
* library to be found when compiling libgit2.
*
* - GIT_FEATURE_SSH
* Libgit2 supports the SSH protocol for network operations. This requires
* the openssh to be found when compiling libgit2
*/
GIT_EXTERN
(
int
)
git_libgit2_
capabiliti
es
(
void
);
GIT_EXTERN
(
int
)
git_libgit2_
featur
es
(
void
);
typedef
enum
{
...
...
src/settings.c
View file @
f34b9a59
...
...
@@ -17,17 +17,17 @@ void git_libgit2_version(int *major, int *minor, int *rev)
*
rev
=
LIBGIT2_VER_REVISION
;
}
int
git_libgit2_
capabiliti
es
()
int
git_libgit2_
featur
es
()
{
return
0
#ifdef GIT_THREADS
|
GIT_
CAP
_THREADS
|
GIT_
FEATURE
_THREADS
#endif
#if defined(GIT_SSL) || defined(GIT_WINHTTP)
|
GIT_
CAP
_HTTPS
|
GIT_
FEATURE
_HTTPS
#endif
#if defined(GIT_SSH)
|
GIT_
CAP
_SSH
|
GIT_
FEATURE
_SSH
#endif
;
}
...
...
tests/core/
cap
s.c
→
tests/core/
feature
s.c
View file @
f34b9a59
#include "clar_libgit2.h"
void
test_core_
cap
s__0
(
void
)
void
test_core_
feature
s__0
(
void
)
{
int
major
,
minor
,
rev
,
caps
;
...
...
@@ -9,23 +9,23 @@ void test_core_caps__0(void)
cl_assert_equal_i
(
LIBGIT2_VER_MINOR
,
minor
);
cl_assert_equal_i
(
LIBGIT2_VER_REVISION
,
rev
);
caps
=
git_libgit2_
capabiliti
es
();
caps
=
git_libgit2_
featur
es
();
#ifdef GIT_THREADS
cl_assert
((
caps
&
GIT_
CAP
_THREADS
)
!=
0
);
cl_assert
((
caps
&
GIT_
FEATURE
_THREADS
)
!=
0
);
#else
cl_assert
((
caps
&
GIT_
CAP
_THREADS
)
==
0
);
cl_assert
((
caps
&
GIT_
FEATURE
_THREADS
)
==
0
);
#endif
#if defined(GIT_SSL) || defined(GIT_WINHTTP)
cl_assert
((
caps
&
GIT_
CAP
_HTTPS
)
!=
0
);
cl_assert
((
caps
&
GIT_
FEATURE
_HTTPS
)
!=
0
);
#else
cl_assert
((
caps
&
GIT_
CAP
_HTTPS
)
==
0
);
cl_assert
((
caps
&
GIT_
FEATURE
_HTTPS
)
==
0
);
#endif
#if defined(GIT_SSH)
cl_assert
((
caps
&
GIT_
CAP
_SSH
)
!=
0
);
cl_assert
((
caps
&
GIT_
FEATURE
_SSH
)
!=
0
);
#else
cl_assert
((
caps
&
GIT_
CAP
_SSH
)
==
0
);
cl_assert
((
caps
&
GIT_
FEATURE
_SSH
)
==
0
);
#endif
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment