mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-28 16:02:01 +03:00
Add option to split patch into a new commit
Add GetHeadCommitMessage to read the subject of the HEAD commit Create PullPatchIntoNewCommit based heavily on PullPatchIntoIndex to split the current patch from its commit and apply it in a separate commit immediately after. WIP to Squash - Fill format string with format string WIP
This commit is contained in:
committed by
Jesse Duffield
parent
3dd33b65a0
commit
7ed8ee160d
@ -441,6 +441,13 @@ func (c *GitCommand) Commit(message string, flags string) (*exec.Cmd, error) {
|
||||
return nil, c.OSCommand.RunCommand(command)
|
||||
}
|
||||
|
||||
// Get the subject of the HEAD commit
|
||||
func (c *GitCommand) GetHeadCommitMessage() (string, error) {
|
||||
cmdStr := "git log -1 --pretty=%s"
|
||||
message, err := c.OSCommand.RunCommandWithOutput(cmdStr)
|
||||
return strings.TrimSpace(message), err
|
||||
}
|
||||
|
||||
// AmendHead amends HEAD with whatever is staged in your working tree
|
||||
func (c *GitCommand) AmendHead() (*exec.Cmd, error) {
|
||||
command := "git commit --amend --no-edit --allow-empty"
|
||||
|
Reference in New Issue
Block a user