pass apiClient to determineBaseRepo
Our code had an unspoken assumption that only one apiClient is created during the course of a command. Violating this assumption is fine in almost all cases, but not when we need to do a re-auth to add a new oauth scope to a user's token. There is likely a more elegant solution to the problem but until then this changes determineBaseRepo to use an existing apiClient.
This commit is contained in:
parent
3a7f56456e
commit
cc1ffb0aea
7 changed files with 29 additions and 36 deletions
|
|
@ -34,7 +34,7 @@ func prCheckout(cmd *cobra.Command, args []string) error {
|
|||
}
|
||||
|
||||
if baseRepo == nil {
|
||||
baseRepo, err = determineBaseRepo(cmd, ctx)
|
||||
baseRepo, err = determineBaseRepo(apiClient, cmd, ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue