Fixed an issue with git hash lookup
This commit is contained in:
parent
504b249d20
commit
eda85943f7
@ -247,9 +247,6 @@ const char* get_svn_revision(void) {
|
|||||||
}
|
}
|
||||||
#endif
|
#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)
|
// Grabs the hash from the last time the user updated their working copy (last pull)
|
||||||
const char *get_git_hash (void) {
|
const char *get_git_hash (void) {
|
||||||
static char GitHash[41] = ""; //Sha(40) + 1
|
static char GitHash[41] = ""; //Sha(40) + 1
|
||||||
@ -258,7 +255,8 @@ const char *get_git_hash (void) {
|
|||||||
if( GitHash[0] != '\0' )
|
if( GitHash[0] != '\0' )
|
||||||
return GitHash;
|
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 line[64];
|
||||||
char *rev = (char*)malloc(sizeof(char) * 50);
|
char *rev = (char*)malloc(sizeof(char) * 50);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user