- def branchStdOut = new ByteArrayOutputStream()
- exec {
- commandLine "git", "rev-parse", "--abbrev-ref", "HEAD"
- standardOutput = branchStdOut
- ignoreExitValue true
- }
+ doFirst {
+ def hashStdOut = new ByteArrayOutputStream()
+ def resultHash = exec {
+ commandLine "git", "rev-parse", "--short", "HEAD"
+ standardOutput = hashStdOut
+ ignoreExitValue true
+ }
+
+ def branchStdOut = new ByteArrayOutputStream()
+ def resultBranch = exec {
+ commandLine "git", "rev-parse", "--abbrev-ref", "HEAD"
+ standardOutput = branchStdOut
+ ignoreExitValue true
+ }