aboutsummaryrefslogtreecommitdiff
path: root/bin/grc
blob: 9a02d9da25e0a05a887afa568eb6ecb38436cd69 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh
# Argument or current dir is a Git repository with uncommitted changes
cd -- "${1:-.}" || exit
if ! isgr ; then
    printf >&2 'grc: Not a Git repository\n'
    exit 1
fi
isgr || exit
[ -n "$(git ls-files --others --exclude-standard)" ] ||
! git diff-index --quiet HEAD