Merge pull request #50670 from sttts/sttts-verbose-unclean-diff

Automatic merge from submit-queue

Make kube::util::ensure_clean_working_dir more verbose in log files

Makes it easier to understand why files seem to be changed during CI build, especially
autogenerated files like conversions.
This commit is contained in:
Kubernetes Submit Queue 2017-08-16 01:04:57 -07:00 committed by GitHub
commit ba110e9f08

View File

@ -484,10 +484,12 @@ kube::util::godep_restored() {
kube::util::ensure_clean_working_dir() { kube::util::ensure_clean_working_dir() {
while ! git diff HEAD --exit-code &>/dev/null; do while ! git diff HEAD --exit-code &>/dev/null; do
echo -e "\nUnexpected dirty working directory:\n" echo -e "\nUnexpected dirty working directory:\n"
git status -s | sed 's/^/ /' if tty -s; then
if ! tty -s; then git status -s
else
git diff -a # be more verbose in log files without tty
exit 1 exit 1
fi fi | sed 's/^/ /'
echo -e "\nCommit your changes in another terminal and then continue here by pressing enter." echo -e "\nCommit your changes in another terminal and then continue here by pressing enter."
read read
done 1>&2 done 1>&2