diff options
author | Seth Tisue <seth@tisue.net> | 2016-09-28 13:07:11 -0700 |
---|---|---|
committer | Seth Tisue <seth@tisue.net> | 2016-09-28 13:07:11 -0700 |
commit | a3008d5ff4871a6f4b86b48197f01027ffee4245 (patch) | |
tree | e770873fcc443ee168cf244b8b09b87fb8d3f6de /tools/get-scala-commit-sha | |
parent | 39b236b482202c8f3decc501e779e67f0414999a (diff) | |
parent | 5757e047a70504991a176aeb2fd8b829d9e9b093 (diff) | |
download | scala-a3008d5ff4871a6f4b86b48197f01027ffee4245.tar.gz scala-a3008d5ff4871a6f4b86b48197f01027ffee4245.tar.bz2 scala-a3008d5ff4871a6f4b86b48197f01027ffee4245.zip |
Merge remote-tracking branch 'origin/2.12.0' into merge-2.12.0-to-2.12.x-sep-24
Diffstat (limited to 'tools/get-scala-commit-sha')
-rwxr-xr-x | tools/get-scala-commit-sha | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/get-scala-commit-sha b/tools/get-scala-commit-sha index eab90a4215..18289c7ca8 100755 --- a/tools/get-scala-commit-sha +++ b/tools/get-scala-commit-sha @@ -10,9 +10,13 @@ [[ $# -eq 0 ]] || cd "$1" -# printf %016s is not portable for 0-padding, has to be a digit. -# so we're stuck disassembling it. -hash=$(git log -1 --format="%H" HEAD) -hash=${hash#g} -hash=${hash:0:10} +if git rev-parse --is-inside-work-tree > /dev/null 2>&1; then + # printf %016s is not portable for 0-padding, has to be a digit. + # so we're stuck disassembling it. + hash=$(git log -1 --format="%H" HEAD) + hash=${hash#g} + hash=${hash:0:10} +else + hash="unknown" +fi echo "$hash" |