Skip to content

Commit

Permalink
Check for dirty files is not accurate
Browse files Browse the repository at this point in the history
grep '^M' was not returning anything. In general diff-index and
ls-files are preferred to status --porcelain.
  • Loading branch information
smarterclayton committed Aug 12, 2014
1 parent b43e386 commit aabd368
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions third_party/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aabd368

Please sign in to comment.