diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-07-20 11:17:01 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2023-07-23 13:55:48 +0200 |
commit | c21633b1be684da2429f68eec034c51eaae4580b (patch) | |
tree | c5f04818334563913e4513b2defc6bbd75a48992 /pkg/commands/git_commands/patch.go | |
parent | 1b05ba252c7e5ff2725b41ca2643c61b9ed84979 (diff) |
Prompt for commit message when moving a custom patch to a new commit
Diffstat (limited to 'pkg/commands/git_commands/patch.go')
-rw-r--r-- | pkg/commands/git_commands/patch.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/pkg/commands/git_commands/patch.go b/pkg/commands/git_commands/patch.go index 56747a315..dba700c3a 100644 --- a/pkg/commands/git_commands/patch.go +++ b/pkg/commands/git_commands/patch.go @@ -1,7 +1,6 @@ package git_commands import ( - "fmt" "path/filepath" "time" @@ -274,7 +273,12 @@ func (self *PatchCommands) MovePatchIntoIndex(commits []*models.Commit, commitId return self.rebase.ContinueRebase() } -func (self *PatchCommands) PullPatchIntoNewCommit(commits []*models.Commit, commitIdx int) error { +func (self *PatchCommands) PullPatchIntoNewCommit( + commits []*models.Commit, + commitIdx int, + commitSummary string, + commitDescription string, +) error { if err := self.rebase.BeginInteractiveRebaseForCommit(commits, commitIdx, false); err != nil { return err } @@ -300,9 +304,7 @@ func (self *PatchCommands) PullPatchIntoNewCommit(commits []*models.Commit, comm return err } - head_message, _ := self.commit.GetHeadCommitMessage() - new_message := fmt.Sprintf("Split from \"%s\"", head_message) - if err := self.commit.CommitCmdObj(new_message, "").Run(); err != nil { + if err := self.commit.CommitCmdObj(commitSummary, commitDescription).Run(); err != nil { return err } |