help: Do not unnecessarily look for a repository
[gitweb.git] / git-rebase--interactive.sh
index 23ded48322bf795b06aa40e4684bc710c8232549..9b1e899e279e63cf3b952d910974ebf619d63bee 100755 (executable)
@@ -408,7 +408,12 @@ do_next () {
                ;;
        *)
                warn "Unknown command: $command $sha1 $rest"
-               die_with_patch $sha1 "Please fix this in the file $TODO."
+               if git rev-parse --verify -q "$sha1" >/dev/null
+               then
+                       die_with_patch $sha1 "Please fix this in the file $TODO."
+               else
+                       die "Please fix this in the file $TODO."
+               fi
                ;;
        esac
        test -s "$TODO" && return