meta: provide an accessor for prerelease info
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/include/git2/common.h b/include/git2/common.h
index c421d3c..52000e8 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 b17485d..efad3bf 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