Merge pull request #42728 from sttts/sttts-udpate-all-dirty-checkout

Automatic merge from submit-queue

Don't try to run hack/verify-staging-* on dirty repository

When the repo is dirty after running all `update-*` scripts in `hack/update-all.sh`, the staging verify scripts still fail. This PR removes these from `hack/update-all.sh`. Instead give useful instructions or continue automatically with `hack/update-all-staging.sh`.
This commit is contained in:
Kubernetes Submit Queue
2017-03-09 05:09:44 -08:00
committed by GitHub
4 changed files with 17 additions and 102 deletions

View File

@@ -453,12 +453,18 @@ kube::util::godep_restored() {
return 0
}
# Exits script if working directory is dirty.
# Exits script if working directory is dirty. If it's run interactively in the terminal
# the user can commit changes in a second terminal. This script will wait.
kube::util::ensure_clean_working_dir() {
if ! git diff --exit-code; then
echo -e "\nUnexpected dirty working directory."
exit 1
fi
while ! git diff HEAD --exit-code &>/dev/null; do
echo -e "\nUnexpected dirty working directory:\n"
git status -s | sed 's/^/ /'
if ! tty -s; then
exit 1
fi
echo -e "\nCommit your changes in another terminal and then continue here by pressing enter."
read
done 1>&2
}
# Ensure that the given godep version is installed and in the path