The goal is to get an unambiguous status that can be evaluated in a shell command.
I tried git status
but it always returns 0, even if there are items
i'd do a test on this:
git diff --quiet --cached
or this to be explicit:
git diff --quiet --exit-code --cached
where:
--exit-code
Make the program exit with codes similar to diff(1). That is, it exits with 1 if there were differences and 0 means no differences.
--quiet
Disable all output of the program. Implies --exit-code