1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

do not include bare repos in recent repos list

This commit is contained in:
Jesse Duffield
2020-09-27 16:02:20 +10:00
parent 23626755d7
commit e873816160
3 changed files with 15 additions and 1 deletions

View File

@ -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
}