diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-27 16:02:20 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-29 17:42:07 +1000 |
commit | e8738161603b5d9844f690214cee7e570a93d5a1 (patch) | |
tree | c0ea40ea6a3d9a602bb46ec09e1de41aeea75f09 /pkg/commands/git.go | |
parent | 23626755d7d4ae3573d25ad73db7bf5be0c495f2 (diff) |
do not include bare repos in recent repos list
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r-- | pkg/commands/git.go | 6 |
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 +} |