Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
Make Pantheon behave as a submodule (#419)
Browse files Browse the repository at this point in the history
* version sniffing should be submodule aware
  • Loading branch information
shemnon authored Dec 14, 2018
1 parent f99457b commit 4d1429c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,11 @@ def calculateVersion() {

def getCheckedOutGitCommitHash() {
def gitFolder = "$projectDir/.git/"
if (!file(gitFolder).isDirectory()) {
// We are in a submodule. The file's contents are `gitdir: <gitFolder>\n`.
// Read the file, cut off the front, and trim the whitespace.
gitFolder = file(gitFolder).text.substring(8).trim() + "/"
}
def takeFromHash = 8
/*
* '.git/HEAD' contains either
Expand Down

0 comments on commit 4d1429c

Please sign in to comment.