Refactor legacy strange git operations (#22756)
During the refactoring of the git module, I found there were some strange operations. This PR tries to fix 2 of them 1. The empty argument `--` in repo_attribute.go, which was introduced by #16773. It seems unnecessary because nothing else would be added later. 2. The complex git service logic in repo/http.go. * Before: the `hasAccess` only allow `service == "upload-pack" || service == "receive-pack"` * After: unrelated code is removed. No need to call ToTrustedCmdArgs anymore. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
d987ac6bf1
commit
50111c71c3
2 changed files with 28 additions and 51 deletions
|
@ -135,8 +135,7 @@ func (c *CheckAttributeReader) Init(ctx context.Context) error {
|
|||
|
||||
c.env = append(c.env, "GIT_FLUSH=1")
|
||||
|
||||
// The empty "--" comes from #16773 , and it seems unnecessary because nothing else would be added later.
|
||||
c.cmd.AddDynamicArguments(c.Attributes...).AddArguments("--")
|
||||
c.cmd.AddDynamicArguments(c.Attributes...)
|
||||
|
||||
var err error
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue