summaryrefslogtreecommitdiffstats
path: root/modules/git
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-02-06 10:23:17 +0800
committerGitHub <noreply@github.com>2023-02-06 10:23:17 +0800
commit50111c71c3d8feedb170a0122c97237f78d1751f (patch)
treecfad0bcfe01c1558772e3df69097d007b039a3ab /modules/git
parentd987ac6bf1d78b3a9bbd213e73b871ebc687acb2 (diff)
downloadgitea-50111c71c3d8feedb170a0122c97237f78d1751f.tar.gz
gitea-50111c71c3d8feedb170a0122c97237f78d1751f.zip
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>
Diffstat (limited to 'modules/git')
-rw-r--r--modules/git/repo_attribute.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/git/repo_attribute.go b/modules/git/repo_attribute.go
index e7d5fb6806..2b34f117f7 100644
--- a/modules/git/repo_attribute.go
+++ b/modules/git/repo_attribute.go
@@ -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