mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-19 12:12:42 +02:00
don't autostash when editing
This commit is contained in:
parent
dcc7855fd0
commit
935f774834
@ -650,8 +650,8 @@ func (c *GitCommand) InteractiveRebase(commits []*Commit, index int, action stri
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
autoStash := action != "edit"
|
// TODO: decide whether to autostash when action == editing
|
||||||
cmd, err := c.PrepareInteractiveRebaseCommand(commits[index+1].Sha, todo, autoStash)
|
cmd, err := c.PrepareInteractiveRebaseCommand(commits[index+1].Sha, todo, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -670,9 +670,12 @@ func (c *GitCommand) PrepareInteractiveRebaseCommand(baseSha string, todo string
|
|||||||
debug = "TRUE"
|
debug = "TRUE"
|
||||||
}
|
}
|
||||||
|
|
||||||
// we do not want to autostash if we are editing
|
autoStashFlag := ""
|
||||||
|
if autoStash {
|
||||||
|
autoStashFlag = "--autostash"
|
||||||
|
}
|
||||||
|
|
||||||
splitCmd := str.ToArgv(fmt.Sprintf("git rebase --interactive --autostash %s", baseSha))
|
splitCmd := str.ToArgv(fmt.Sprintf("git rebase --interactive %s %s", autoStashFlag, baseSha))
|
||||||
|
|
||||||
cmd := exec.Command(splitCmd[0], splitCmd[1:]...)
|
cmd := exec.Command(splitCmd[0], splitCmd[1:]...)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user