1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-19 00:28:03 +02:00

fix commit amend

This commit is contained in:
Jesse Duffield
2021-04-10 11:40:42 +10:00
parent 93fac1f312
commit e42e7e5cbd
31 changed files with 1963 additions and 1985 deletions

View File

@ -23,7 +23,7 @@ func (c *GitCommand) DeletePatchesFromCommit(commits []*models.Commit, commitInd
}
// time to amend the selected commit
if _, err := c.AmendHead(); err != nil {
if err := c.AmendHead(); err != nil {
return err
}
@ -51,7 +51,7 @@ func (c *GitCommand) MovePatchToSelectedCommit(commits []*models.Commit, sourceC
}
// amend the destination commit
if _, err := c.AmendHead(); err != nil {
if err := c.AmendHead(); err != nil {
return err
}
@ -71,7 +71,7 @@ func (c *GitCommand) MovePatchToSelectedCommit(commits []*models.Commit, sourceC
// we can make this GPG thing possible it just means we need to do this in two parts:
// one where we handle the possibility of a credential request, and the other
// where we continue the rebase
if c.usingGpg() {
if c.UsingGpg() {
return errors.New(c.Tr.DisabledForGPG)
}
@ -103,7 +103,7 @@ func (c *GitCommand) MovePatchToSelectedCommit(commits []*models.Commit, sourceC
}
// amend the source commit
if _, err := c.AmendHead(); err != nil {
if err := c.AmendHead(); err != nil {
return err
}
@ -122,7 +122,7 @@ func (c *GitCommand) MovePatchToSelectedCommit(commits []*models.Commit, sourceC
}
// amend the destination commit
if _, err := c.AmendHead(); err != nil {
if err := c.AmendHead(); err != nil {
return err
}
@ -158,7 +158,7 @@ func (c *GitCommand) PullPatchIntoIndex(commits []*models.Commit, commitIdx int,
}
// amend the commit
if _, err := c.AmendHead(); err != nil {
if err := c.AmendHead(); err != nil {
return err
}
@ -203,7 +203,7 @@ func (c *GitCommand) PullPatchIntoNewCommit(commits []*models.Commit, commitIdx
}
// amend the commit
if _, err := c.AmendHead(); err != nil {
if err := c.AmendHead(); err != nil {
return err
}
@ -217,7 +217,7 @@ func (c *GitCommand) PullPatchIntoNewCommit(commits []*models.Commit, commitIdx
head_message, _ := c.GetHeadCommitMessage()
new_message := fmt.Sprintf("Split from \"%s\"", head_message)
_, err := c.Commit(new_message, "")
err := c.OSCommand.RunCommand(c.CommitCmdStr(new_message, ""))
if err != nil {
return err
}