bootstrap.bash: only fetch git revision if we need it

Updates #22912
Fixes #23610

Change-Id: Id1c91fc3f040412d5931dba40e430685793f8eea
Reviewed-on: https://go-review.googlesource.com/90715
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Ian Lance Taylor 2018-01-29 20:35:43 -08:00
parent 14f8027a10
commit 32a08d09b8

View file

@ -77,7 +77,11 @@ else
rm -rf "pkg/${gohostos}_${gohostarch}" "pkg/tool/${gohostos}_${gohostarch}"
fi
GITREV=$(git rev-parse --short HEAD)
if [ "$BOOTSTRAP_FORMAT" = "mintgz" ]; then
# Fetch git revision before rm -rf .git.
GITREV=$(git rev-parse --short HEAD)
fi
rm -rf pkg/bootstrap pkg/obj .git
# Support for building minimal tar.gz for the builders.