mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-11-26 09:00:57 +02:00
Added rebase support commands
This commit is contained in:
parent
34fd18a395
commit
7a7e885773
@ -269,6 +269,10 @@ func (c *GitCommand) RebaseBranch(onto string) error {
|
||||
return c.OSCommand.RunCommand(fmt.Sprintf("git rebase %s %s ", onto, curBranch))
|
||||
}
|
||||
|
||||
func (c *GitCommand) ContinueRebaseBranch() error {
|
||||
return c.OSCommand.RunCommand("git rebase --continue")
|
||||
}
|
||||
|
||||
func (c *GitCommand) AbortRebaseBranch() error {
|
||||
return c.OSCommand.RunCommand("git rebase --abort")
|
||||
}
|
||||
@ -450,6 +454,14 @@ func (c *GitCommand) IsInMergeState() (bool, error) {
|
||||
return strings.Contains(output, "conclude merge") || strings.Contains(output, "unmerged paths"), nil
|
||||
}
|
||||
|
||||
func (c *GitCommand) IsInRebaseState() (bool, error) {
|
||||
output, err := c.OSCommand.RunCommandWithOutput("git status --untracked-files=all")
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return strings.Contains(output, "rebase in progress"), nil
|
||||
}
|
||||
|
||||
// RemoveFile directly
|
||||
func (c *GitCommand) RemoveFile(file *File) error {
|
||||
// if the file isn't tracked, we assume you want to delete it
|
||||
|
Loading…
Reference in New Issue
Block a user