mirror of https://github.com/apache/kafka.git
KAFKA-1901; Added error handling when no file exists in .git/refs/heads.
guozhangwang added .git/refs/heads/ file existence check. Author: Manikumar reddy O <manikumar.reddy@gmail.com> Reviewers: Ismael Juma, Guozhang Wang Closes #209 from omkreddy/KAFKA-1901
This commit is contained in:
parent
b098f677ae
commit
25fa39d5ef
|
|
@ -431,13 +431,14 @@ project(':clients') {
|
|||
def headRef = file("../.git/HEAD").text
|
||||
if (headRef.contains('ref: ')) {
|
||||
headRef = headRef.replaceAll('ref: ', '').trim()
|
||||
commitId = file("../.git/$headRef").text.trim().take(takeFromHash)
|
||||
if (file("../.git/$headRef").exists()) {
|
||||
commitId = file("../.git/$headRef").text.trim().take(takeFromHash)
|
||||
}
|
||||
} else {
|
||||
commitId = headRef.trim().take(takeFromHash)
|
||||
}
|
||||
} else {
|
||||
commitId
|
||||
}
|
||||
}
|
||||
commitId
|
||||
}
|
||||
|
||||
task createVersionFile(dependsOn: determineCommitId) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue