compare sha local first if sha is given
also switch branches if sha is equal
correct 'changed' output
branch name may contain slashes, remote as well