From 25e74d3f23b1c921a352c8040ade7e35c29a84fb Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Wed, 30 Jan 2019 10:56:44 -0800 Subject: [PATCH] vet: use fail_on_output so user can see why git client is not porcelain (#2605) --- vet.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/vet.sh b/vet.sh index 98f9712f..0610935c 100755 --- a/vet.sh +++ b/vet.sh @@ -13,10 +13,12 @@ die() { exit 1 } +fail_on_output() { + tee /dev/stderr | (! read) +} + # Check to make sure it's safe to modify the user's git repo. -if git status --porcelain | read; then - die "Uncommitted or untracked files found; commit changes first" -fi +git status --porcelain | fail_on_output # Undo any edits made by this script. cleanup() { @@ -24,10 +26,6 @@ cleanup() { } trap cleanup EXIT -fail_on_output() { - tee /dev/stderr | (! read) -} - PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}" if [[ "$1" = "-install" ]]; then