diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2022-02-14 07:12:36 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2022-02-14 07:13:05 -0500 |
commit | 056fe4be05cd8623fb210a1be4aa0529ce08ed66 (patch) | |
tree | 85d4d879f63838dec6ad87d902f4b29e2ad73a18 | |
parent | ae74d5ac41aa6158442f4643f285ab8b71a7750d (diff) | |
download | libgit2-056fe4be05cd8623fb210a1be4aa0529ce08ed66.tar.gz |
meta: provide an accessor for prerelease info
-rw-r--r-- | include/git2/common.h | 11 | ||||
-rw-r--r-- | src/libgit2.c | 5 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/git2/common.h b/include/git2/common.h index c421d3cc1..52000e8eb 100644 --- a/include/git2/common.h +++ b/include/git2/common.h @@ -122,6 +122,17 @@ GIT_BEGIN_DECL GIT_EXTERN(int) git_libgit2_version(int *major, int *minor, int *rev); /** + * Return the prerelease state of the libgit2 library currently being + * used. For nightly builds during active development, this will be + * "alpha". Releases may have a "beta" or release candidate ("rc1", + * "rc2", etc) prerelease. For a final release, this function returns + * NULL. + * + * @return the name of the prerelease state or NULL + */ +GIT_EXTERN(const char *) git_libgit2_prerelease(void); + +/** * Combinations of these values describe the features with which libgit2 * was compiled */ diff --git a/src/libgit2.c b/src/libgit2.c index b17485d7f..efad3bf6d 100644 --- a/src/libgit2.c +++ b/src/libgit2.c @@ -107,6 +107,11 @@ int git_libgit2_version(int *major, int *minor, int *rev) return 0; } +const char *git_libgit2_prerelease(void) +{ + return LIBGIT2_VER_PRERELEASE; +} + int git_libgit2_features(void) { return 0 |