blob: 884d654be0fd9adbf85962beca6d5f6b0ba83396 [file] [log] [blame]
#!/bin/bash
git fetch
# diff-index requires update-index --refresh; see:
# https://stackoverflow.com/questions/36367190/git-diff-files-output-changes-after-git-status/36439778#36439778
git update-index --refresh > /dev/null
if ! git diff-index --quiet HEAD -- ; then
echo "dirty"
elif ! git merge-base --is-ancestor HEAD origin/main ; then
echo "dirty"
else
echo "clean"
fi