mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 03:18:24 +00:00 
			
		
		
		
	Performance optimization for git push (#30104)
Agit returned result should be from `ProcReceive` hook but not `PostReceive` hook. Then for all non-agit pull requests, it will not check the pull requests for every pushing `refs/pull/%d/head`.
This commit is contained in:
		| @@ -49,6 +49,17 @@ func testGitPush(t *testing.T, u *url.URL) { | ||||
| 		}) | ||||
| 	}) | ||||
|  | ||||
| 	t.Run("Push branch with options", func(t *testing.T) { | ||||
| 		runTestGitPush(t, u, func(t *testing.T, gitPath string) (pushed, deleted []string) { | ||||
| 			branchName := "branch-with-options" | ||||
| 			doGitCreateBranch(gitPath, branchName)(t) | ||||
| 			doGitPushTestRepository(gitPath, "origin", branchName, "-o", "repo.private=true", "-o", "repo.template=true")(t) | ||||
| 			pushed = append(pushed, branchName) | ||||
|  | ||||
| 			return pushed, deleted | ||||
| 		}) | ||||
| 	}) | ||||
|  | ||||
| 	t.Run("Delete branches", func(t *testing.T) { | ||||
| 		runTestGitPush(t, u, func(t *testing.T, gitPath string) (pushed, deleted []string) { | ||||
| 			doGitPushTestRepository(gitPath, "origin", "master")(t) // make sure master is the default branch instead of a branch we are going to delete | ||||
|   | ||||
		Reference in New Issue
	
	Block a user