Skip to content

Commit 056fe4b

Browse files
committed
meta: provide an accessor for prerelease info
1 parent ae74d5a commit 056fe4b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

include/git2/common.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,17 @@ GIT_BEGIN_DECL
121121
*/
122122
GIT_EXTERN(int) git_libgit2_version(int *major, int *minor, int *rev);
123123

124+
/**
125+
* Return the prerelease state of the libgit2 library currently being
126+
* used. For nightly builds during active development, this will be
127+
* "alpha". Releases may have a "beta" or release candidate ("rc1",
128+
* "rc2", etc) prerelease. For a final release, this function returns
129+
* NULL.
130+
*
131+
* @return the name of the prerelease state or NULL
132+
*/
133+
GIT_EXTERN(const char *) git_libgit2_prerelease(void);
134+
124135
/**
125136
* Combinations of these values describe the features with which libgit2
126137
* was compiled

src/libgit2.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ int git_libgit2_version(int *major, int *minor, int *rev)
107107
return 0;
108108
}
109109

110+
const char *git_libgit2_prerelease(void)
111+
{
112+
return LIBGIT2_VER_PRERELEASE;
113+
}
114+
110115
int git_libgit2_features(void)
111116
{
112117
return 0

0 commit comments

Comments
 (0)