From eda85943f7516bc8e90202c9978301d91a1585ea Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Tue, 18 Jul 2017 23:02:31 +0200 Subject: [PATCH] Fixed an issue with git hash lookup --- src/common/core.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/common/core.cpp b/src/common/core.cpp index 22f5a3d147..7d3ddbe530 100644 --- a/src/common/core.cpp +++ b/src/common/core.cpp @@ -247,9 +247,6 @@ const char* get_svn_revision(void) { } #endif -// GIT path -#define GIT_ORIGIN "refs/remotes/origin/master" - // Grabs the hash from the last time the user updated their working copy (last pull) const char *get_git_hash (void) { static char GitHash[41] = ""; //Sha(40) + 1 @@ -258,7 +255,8 @@ const char *get_git_hash (void) { if( GitHash[0] != '\0' ) return GitHash; - if( (fp = fopen(".git/" GIT_ORIGIN, "r")) != NULL ) { + if( (fp = fopen(".git/refs/remotes/origin/master", "r")) != NULL || // Already pulled once + (fp = fopen(".git/refs/heads/master", "r")) != NULL ) { // Cloned only char line[64]; char *rev = (char*)malloc(sizeof(char) * 50);