Fix error when current path is not a git repo
Fix invalid cast when resetting submodule changes