diff --git a/magit.el b/magit.el index 2b1c1e49..d0ce8b26 100644 --- a/magit.el +++ b/magit.el @@ -2144,7 +2144,8 @@ in log buffer." (or (not (magit-read-rewrite-info)) (error "Rewrite in progress.")) (let* ((orig (magit-git-string "rev-parse HEAD")) - (base (magit-git-string "rev-parse %s^" from)) + (base (or (car (magit-commit-parents from)) + (error "Can't rewrite a commit without a parent, sorry."))) (pending (magit-git-lines "rev-list %s.." base))) (magit-write-rewrite-info `((orig ,orig) (pending ,@(mapcar #'list pending))))