summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-09-27 16:02:20 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-09-29 17:42:07 +1000
commite8738161603b5d9844f690214cee7e570a93d5a1 (patch)
treec0ea40ea6a3d9a602bb46ec09e1de41aeea75f09 /pkg/commands
parent23626755d7d4ae3573d25ad73db7bf5be0c495f2 (diff)
do not include bare repos in recent repos list
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/git.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index da4324d4d..dcd1729af 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -1427,3 +1427,9 @@ func (c *GitCommand) WorkingTreeState() string {
}
return "normal"
}
+
+func (c *GitCommand) IsBareRepo() bool {
+ // note: could use `git rev-parse --is-bare-repository` if we wanna drop go-git
+ _, err := c.Repo.Worktree()
+ return err == gogit.ErrIsBareRepository
+}