Conversation
| if currentDefaultRepo.Remote != nil { | ||
| if currentDefaultRepo.Remote.Resolved != "base" { | ||
| current = currentDefaultRepo.Remote.Resolved | ||
| } | ||
| } |
There was a problem hiding this comment.
Do we need to make the check that the remote is not nil? Seems like that is already guaranteed by virtue of currentDefaultRepo being set from ResolvedRemote().
Additionally if the resolved value is "base" should we be keeping the previous behavior of current = ghrepo.FullName(currentDefaultRepo)?
There was a problem hiding this comment.
Do we need to make the check that the remote is not nil? Seems like that is already guaranteed by virtue of currentDefaultRepo being set from ResolvedRemote().
I suppose not but I felt like being defensive.
Additionally if the resolved value is "base" should we be keeping the previous behavior of current = ghrepo.FullName(currentDefaultRepo)?
no; that is precisely the case that resulted in the panic of #6808
There was a problem hiding this comment.
Instead of this workaround, which is not very self-evident to me even with the added explanatory comment, could the workaround be to add a guard around Prompter.Select to ensure that current exists within repoNames and make the default blank if not?
| if currentDefaultRepo.Remote != nil { | ||
| if currentDefaultRepo.Remote.Resolved != "base" { | ||
| current = currentDefaultRepo.Remote.Resolved | ||
| } | ||
| } |
There was a problem hiding this comment.
Instead of this workaround, which is not very self-evident to me even with the added explanatory comment, could the workaround be to add a guard around Prompter.Select to ensure that current exists within repoNames and make the default blank if not?
|
closing in favor of #6831 |
Fixes #6808
gnarly hack for gnarly times