You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handle UserLogin properly when creating repositories
- GitHub/Gitea/GitLab providers:
The `UserRepositoriesClient.Create` method's `UserRepositoryRef`
parameter contains a `UserLogin` field which is not taken into
account for this call. Instead, the repository is actually created
in the namespace of the user that is tied to the token used by the
respective `gitprovider.Client` implementation.
If a user now passed in a `UserLogin` that is different from the one
derived from the token, the return value of `Create` would still
contain the wrong `UserLogin` passed in to `Create` and methods like
`GetCloneURL` would return the wrong URL.
With this commit, the returned `UserRepository` now points to the
correct owner of the repository.
- Stash/Bitbucket Server:
The Stash provider actually took the field into account and would
fail to create the repository even when the token was correct. To
align this provider's behaviour with the others, it now also creates
the repository under the token user's account and ignores the
provided `UserRepositoryRef.UserLogin` field.
Signed-off-by: Max Jonas Werner <[email protected]>
0 commit comments