#include <string.h>
#include <version.h>

/* - On some systems git is not installed or
 *   installed on a place where FindGit.cmake cannot find it
 * - No git information is present (no .git directory)
 * in those cases clear the gitVersionString (would have string GIT-NOTFOUND).
 */
const char *getGitVersion(void)
{
#define BUF_SIZE 100
  static char gitVersionString[BUF_SIZE];
  static bool init = false;
  if (!init)
  {
    strncpy(gitVersionString,"a2e22797de7d4e54bd6cf4fc752b8b1f5bd5bd80",BUF_SIZE-1);
    strncat(gitVersionString,!strcmp("false","true")?"*":"",BUF_SIZE-1);
    if (!strcmp("a2e22797de7d4e54bd6cf4fc752b8b1f5bd5bd80", "GIT-NOTFOUND")) gitVersionString[0] = '\0';
    gitVersionString[BUF_SIZE-1]='\0';
    init = true;
  }
  return gitVersionString;
}
