From aabd3683eb571e691f3a739882bf71065881a80d Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Thu, 7 Aug 2014 16:31:41 -0400 Subject: [PATCH] Check for dirty files is not accurate grep '^M' was not returning anything. In general diff-index and ls-files are preferred to status --porcelain. --- third_party/update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/update.sh b/third_party/update.sh index 013955663d5..c7ca1022316 100755 --- a/third_party/update.sh +++ b/third_party/update.sh @@ -2,8 +2,8 @@ set -e -if (( $(git status --porcelain 2>/dev/null | grep "^M" | wc -l) > 0 )); then - echo "You can't have any staged files in git when updating packages." +if ! git diff-index --quiet HEAD -- || test $(git ls-files --exclude-standard --others third_party/src | wc -l) != 0; then + echo "You can't have any staged files or changes in third_party/src/ in git when updating packages." echo "Either commit them or unstage them to continue." exit 1 fi