Explicitly disallow rewriting history from the first commit.
* magit.el (magit-rewrite-start): Use magit-commit-parents to find base commit for rewrite and signal error if there isn't any.
This commit is contained in:
parent
7700954ee4
commit
cd4f15f314
1 changed files with 2 additions and 1 deletions
3
magit.el
3
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))))
|
||||
|
|
Loading…
Reference in a new issue