More robust check for dirty git repos

This check will mark the repo as dirty if there are any staged or unstaged changes. Currently the check fails if there are untracked files in the repo