change type of cherryPickedCommits from []string to []*Commit

This commit is contained in:
Jesse Duffield Duffield 2019-02-24 17:34:19 +11:00
parent 639df512f3
commit f4938deaae
4 changed files with 47 additions and 51 deletions

View file

@ -746,11 +746,11 @@ func (c *GitCommand) Revert(sha string) error {
return c.OSCommand.RunCommand(fmt.Sprintf("git revert %s", sha))
}
// CherryPickShas begins an interactive rebase with the given shas being cherry picked onto HEAD
func (c *GitCommand) CherryPickShas(shas []string) error {
// CherryPickCommits begins an interactive rebase with the given shas being cherry picked onto HEAD
func (c *GitCommand) CherryPickCommits(commits []*Commit) error {
todo := ""
for _, sha := range shas {
todo = "pick " + sha + "\n" + todo
for _, commit := range commits {
todo = "pick " + commit.Sha + " " + commit.Name + "\n" + todo
}
cmd, err := c.PrepareInteractiveRebaseCommand("HEAD", todo, false)