Fix git rev-parse when branch is specified