Skip to content

Instantly share code, notes, and snippets.

@akkyie
Created July 27, 2018 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akkyie/102b04b3e55c10398bf3eda3850016c3 to your computer and use it in GitHub Desktop.
Save akkyie/102b04b3e55c10398bf3eda3850016c3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
if [[ $# < 1 ]]; then
echo "USAGE: $0 PATTERNS"
exit 1
fi
IFS=$'\n'
for PATTERN in "$@"; do
STATUS=$(git status $PATTERN --porcelain)
if [[ $STATUS != "" ]]; then
echo "$PATTERN changed"
exit 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment