+ def branchStdOut = new ByteArrayOutputStream()
+ def resultBranch = exec {
+ commandLine "git", "rev-parse", "--abbrev-ref", "HEAD"
+ standardOutput = branchStdOut
+ ignoreExitValue true
+ }
+
+ gitHash = resultHash.getExitValue() == 0 ? hashStdOut.toString().trim() : "NO_GIT_COMMITID_FOUND"
+ gitBranch = resultBranch.getExitValue() == 0 ? branchStdOut.toString().trim() : "NO_GIT_BRANCH_FOUND"
+ }