Skip to content

Commit

Permalink
Improve git revision detection
Browse files Browse the repository at this point in the history
Relates elastic#262
  • Loading branch information
costin committed Sep 8, 2014
1 parent 5e724b4 commit aa98405
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.gradle
Expand Up @@ -114,7 +114,11 @@ def File gitBranch() {
File gitHead = file("$rootDir/.git/HEAD")

if (gitHead.exists()) {
return file("$rootDir/.git/" + gitHead.text.trim().replace('ref: ',''))
String content = gitHead.text.trim()
if (content.startsWith("ref:")) {
return file("$rootDir/.git/" + replace('ref: ',''))
}
return gitHead
}
return null
}
Expand Down

0 comments on commit aa98405

Please sign in to comment.