summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-03-28 12:08:13 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-03-28 13:19:35 +1100
commita9559a5c8738d6938f8750f0729f077e0842800e (patch)
tree6bf8ae15c80891325227261d46880d5f2e553c0b /pkg/commands
parent814ee24c8d13ae554925530ec68f325394ddfe6d (diff)
move working tree state function into git.go
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/git.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index f2a4706cc..19fe9c219 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -1192,3 +1192,15 @@ func (c *GitCommand) colorArg() string {
func (c *GitCommand) RenameBranch(oldName string, newName string) error {
return c.OSCommand.RunCommand("git branch --move %s %s", oldName, newName)
}
+
+func (c *GitCommand) WorkingTreeState() string {
+ rebaseMode, _ := c.RebaseMode()
+ if rebaseMode != "" {
+ return "rebasing"
+ }
+ merging, _ := c.IsInMergeState()
+ if merging {
+ return "merging"
+ }
+ return "normal"
+}