Check for dirty files is not accurate

grep '^M' was not returning anything. In general diff-index and
ls-files are preferred to status --porcelain.

Could use some testing.
Debug code?