summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-11-17 13:21:38 +1100
committerJesse Duffield <jessedduffield@gmail.com>2019-11-21 22:07:14 +1100
commit2afbd7ba7fcd3668d7c70b831e525741e6214bd5 (patch)
treeba81a610920249818773befbfe0d051802244910 /pkg/commands
parent55ff0c0dee09b505ecd123f3f893e143651947bf (diff)
support merging remote branches into checked out branch
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/git.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 65e17a3a1..e385d6159 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -1080,3 +1080,8 @@ func (c *GitCommand) AddRemote(name string, url string) error {
func (c *GitCommand) RemoveRemote(name string) error {
return c.OSCommand.RunCommand(fmt.Sprintf("git remote remove %s", name))
}
+
+func (c *GitCommand) IsHeadDetached() bool {
+ err := c.OSCommand.RunCommand("git symbolic-ref -q HEAD")
+ return err != nil
+}