Fix gitcommit() in hack/config-go.sh

Previously it would only print a version when the tree was dirty. Fix it
so that it will also print one on a clean tree.

Tested:
- Built it from a committed tree:
  $ hack/build-go.sh
  $ output/go/bin/kubelet -version
  Kubernetes version 0.1, build a091590dd10c

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
This commit is contained in:
Filipe Brandenburger 2014-08-27 09:14:51 -07:00
parent 923b2c12c2
commit 7785f14b32

View File

@ -31,6 +31,8 @@ function gitcommit() {
# Check if the tree is dirty.
if ! dirty_tree=$(git status --porcelain) || [[ -n "${dirty_tree}" ]]; then
echo "${git_commit}-dirty"
else
echo "${git_commit}"
fi
else
echo "(none)"