mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-13 05:15:53 +02:00
Revert "remove old rebase code now that we're only ever interactively rebasing"
This reverts commit 1a19b1412d
.
This commit is contained in:
parent
399346c2ee
commit
0c886eddfb
3 changed files with 98 additions and 13 deletions
|
@ -419,9 +419,22 @@ func (c *GitCommand) IsInMergeState() (bool, error) {
|
|||
return strings.Contains(output, "conclude merge") || strings.Contains(output, "unmerged paths"), nil
|
||||
}
|
||||
|
||||
// IsInRebasingState tells us if we are rebasing
|
||||
func (c *GitCommand) IsInRebasingState() (bool, error) {
|
||||
return c.OSCommand.FileExists(".git/rebase-merge")
|
||||
// RebaseMode returns "" for non-rebase mode, "normal" for normal rebase
|
||||
// and "interactive" for interactive rebase
|
||||
func (c *GitCommand) RebaseMode() (string, error) {
|
||||
exists, err := c.OSCommand.FileExists(".git/rebase-apply")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if exists {
|
||||
return "normal", nil
|
||||
}
|
||||
exists, err = c.OSCommand.FileExists(".git/rebase-merge")
|
||||
if exists {
|
||||
return "interactive", err
|
||||
} else {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
// RemoveFile directly
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue