mirror of
https://github.com/go-gitea/gitea
synced 2025-08-09 02:58:20 +00:00
Backport #25733 by @hiifong When only the casing of the username changes, update the owner name of the repo, and keep the original logic consistent with other conditions. example: assume your username is `gitea`, lowercase username is `gitea` too, repo URL is `.../gitea/{repo}`. You change your username to `Gitea`, `GiTea` or something like that, as long as the lowercase username is still `gitea`, the repo URL remained `.../gitea/{repo}`. this pr keeps the new username consistent with the repo URL. Before:   After:   Co-authored-by: hiifong <i@hiif.ong>
This commit is contained in:
@@ -58,7 +58,7 @@ func RenameUser(ctx context.Context, u *user_model.User, newUserName string) err
|
||||
u.Name = oldUserName
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return repo_model.UpdateRepositoryOwnerNames(u.ID, newUserName)
|
||||
}
|
||||
|
||||
ctx, committer, err := db.TxContext(ctx)
|
||||
|
Reference in New Issue
Block a user