fix regression in support for detached HEAD state

for gh pr status
This commit is contained in:
naman 2020-06-10 11:41:44 -07:00
parent 28f91cbed8
commit 3bb6983b35
4 changed files with 12 additions and 6 deletions

View file

@ -207,7 +207,11 @@ func (c *fsContext) Branch() (string, error) {
}
currentBranch, err := git.CurrentBranch()
if err != nil {
switch err {
case nil:
case git.ErrNotOnAnyBranch:
return "", err
default:
return "", fmt.Errorf("could not determine current branch: %w", err)
}