summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-04-18 17:34:07 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-04-18 17:34:07 +0200
commit21072226d24bf8e2cd9dbd2085b969303a1797eb (patch)
treefe2626adb4c2e3a64ac07416050400fcf1c4fe80
parentb09000194a571579dddb1f0793a4d8c5d0e8d99c (diff)
Don't allow resetting non-HEAD commits (including rebase todos) during rebase
-rw-r--r--pkg/gui/controllers/local_commits_controller.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/gui/controllers/local_commits_controller.go b/pkg/gui/controllers/local_commits_controller.go
index 4610aed12..35e314357 100644
--- a/pkg/gui/controllers/local_commits_controller.go
+++ b/pkg/gui/controllers/local_commits_controller.go
@@ -474,6 +474,10 @@ func (self *LocalCommitsController) amendTo(commit *models.Commit) error {
}
func (self *LocalCommitsController) amendAttribute(commit *models.Commit) error {
+ if self.git.Status.WorkingTreeState() != enums.REBASE_MODE_NONE && !self.isHeadCommit() {
+ return self.c.ErrorMsg(self.c.Tr.AlreadyRebasing)
+ }
+
return self.c.Menu(types.CreateMenuOptions{
Title: "Amend commit attribute",
Items: []*types.MenuItem{