mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Make git clone URL could use current signed-in user (#33091)
close #33086 * Add a special value for "SSH_USER" setting: `(DOER_USERNAME)` * Improve parseRepositoryURL and add tests (now it doesn't have hard dependency on some setting values) Many changes are just adding "ctx" and "doer" argument to functions. By the way, improve app.example.ini, remove all `%(key)s` syntax, it only makes messy and no user really cares about it. Document: https://gitea.com/gitea/docs/pulls/138
This commit is contained in:
@@ -33,7 +33,9 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, permissionInR
|
||||
permissionInRepo.SetUnitsWithDefaultAccessMode(repo.Units, permissionInRepo.AccessMode)
|
||||
}
|
||||
|
||||
cloneLink := repo.CloneLink()
|
||||
// TODO: ideally we should pass "doer" into "ToRepo" to to make CloneLink could generate user-related links
|
||||
// And passing "doer" in will also fix other FIXMEs in this file.
|
||||
cloneLink := repo.CloneLinkGeneral(ctx) // no doer at the moment
|
||||
permission := &api.Permission{
|
||||
Admin: permissionInRepo.AccessMode >= perm.AccessModeAdmin,
|
||||
Push: permissionInRepo.UnitAccessMode(unit_model.TypeCode) >= perm.AccessModeWrite,
|
||||
|
Reference in New Issue
Block a user