@@ -181,6 +181,7 @@ Gitea or set your environment appropriately.`, "")
181181	// the environment is set by serv command 
182182	isWiki , _  :=  strconv .ParseBool (os .Getenv (repo_module .EnvRepoIsWiki ))
183183	username  :=  os .Getenv (repo_module .EnvRepoUsername )
184+ 	groupID , _  :=  strconv .ParseInt (os .Getenv (repo_module .EnvRepoGroupID ), 10 , 64 )
184185	reponame  :=  os .Getenv (repo_module .EnvRepoName )
185186	userID , _  :=  strconv .ParseInt (os .Getenv (repo_module .EnvPusherID ), 10 , 64 )
186187	prID , _  :=  strconv .ParseInt (os .Getenv (repo_module .EnvPRID ), 10 , 64 )
@@ -254,7 +255,7 @@ Gitea or set your environment appropriately.`, "")
254255				hookOptions .OldCommitIDs  =  oldCommitIDs 
255256				hookOptions .NewCommitIDs  =  newCommitIDs 
256257				hookOptions .RefFullNames  =  refFullNames 
257- 				extra  :=  private .HookPreReceive (ctx , username , reponame , hookOptions )
258+ 				extra  :=  private .HookPreReceive (ctx , username , reponame , groupID ,  hookOptions )
258259				if  extra .HasError () {
259260					return  fail (ctx , extra .UserMsg , "HookPreReceive(batch) failed: %v" , extra .Error )
260261				}
@@ -277,7 +278,7 @@ Gitea or set your environment appropriately.`, "")
277278
278279		fmt .Fprintf (out , " Checking %d references\n " , count )
279280
280- 		extra  :=  private .HookPreReceive (ctx , username , reponame , hookOptions )
281+ 		extra  :=  private .HookPreReceive (ctx , username , reponame , groupID ,  hookOptions )
281282		if  extra .HasError () {
282283			return  fail (ctx , extra .UserMsg , "HookPreReceive(last) failed: %v" , extra .Error )
283284		}
@@ -350,6 +351,7 @@ Gitea or set your environment appropriately.`, "")
350351	pusherID , _  :=  strconv .ParseInt (os .Getenv (repo_module .EnvPusherID ), 10 , 64 )
351352	prID , _  :=  strconv .ParseInt (os .Getenv (repo_module .EnvPRID ), 10 , 64 )
352353	pusherName  :=  os .Getenv (repo_module .EnvPusherName )
354+ 	groupID , _  :=  strconv .ParseInt (os .Getenv (repo_module .EnvRepoGroupID ), 10 , 64 )
353355
354356	hookOptions  :=  private.HookOptions {
355357		UserName :                        pusherName ,
@@ -399,7 +401,7 @@ Gitea or set your environment appropriately.`, "")
399401			hookOptions .OldCommitIDs  =  oldCommitIDs 
400402			hookOptions .NewCommitIDs  =  newCommitIDs 
401403			hookOptions .RefFullNames  =  refFullNames 
402- 			resp , extra  :=  private .HookPostReceive (ctx , repoUser , repoName , hookOptions )
404+ 			resp , extra  :=  private .HookPostReceive (ctx , repoUser , repoName , groupID ,  hookOptions )
403405			if  extra .HasError () {
404406				_  =  dWriter .Close ()
405407				hookPrintResults (results )
@@ -414,7 +416,7 @@ Gitea or set your environment appropriately.`, "")
414416	if  count  ==  0  {
415417		if  wasEmpty  &&  masterPushed  {
416418			// We need to tell the repo to reset the default branch to master 
417- 			extra  :=  private .SetDefaultBranch (ctx , repoUser , repoName , "master" )
419+ 			extra  :=  private .SetDefaultBranch (ctx , repoUser , repoName , groupID ,  "master" )
418420			if  extra .HasError () {
419421				return  fail (ctx , extra .UserMsg , "SetDefaultBranch failed: %v" , extra .Error )
420422			}
@@ -432,7 +434,7 @@ Gitea or set your environment appropriately.`, "")
432434
433435	fmt .Fprintf (out , " Processing %d references\n " , count )
434436
435- 	resp , extra  :=  private .HookPostReceive (ctx , repoUser , repoName , hookOptions )
437+ 	resp , extra  :=  private .HookPostReceive (ctx , repoUser , repoName , groupID ,  hookOptions )
436438	if  resp  ==  nil  {
437439		_  =  dWriter .Close ()
438440		hookPrintResults (results )
@@ -445,7 +447,7 @@ Gitea or set your environment appropriately.`, "")
445447
446448	if  wasEmpty  &&  masterPushed  {
447449		// We need to tell the repo to reset the default branch to master 
448- 		extra  :=  private .SetDefaultBranch (ctx , repoUser , repoName , "master" )
450+ 		extra  :=  private .SetDefaultBranch (ctx , repoUser , repoName , groupID ,  "master" )
449451		if  extra .HasError () {
450452			return  fail (ctx , extra .UserMsg , "SetDefaultBranch failed: %v" , extra .Error )
451453		}
@@ -513,6 +515,7 @@ Gitea or set your environment appropriately.`, "")
513515	repoName  :=  os .Getenv (repo_module .EnvRepoName )
514516	pusherID , _  :=  strconv .ParseInt (os .Getenv (repo_module .EnvPusherID ), 10 , 64 )
515517	pusherName  :=  os .Getenv (repo_module .EnvPusherName )
518+ 	groupID , _  :=  strconv .ParseInt (os .Getenv (repo_module .EnvRepoGroupID ), 10 , 64 )
516519
517520	// 1. Version and features negotiation. 
518521	// S: PKT-LINE(version=1\0push-options atomic...) / PKT-LINE(version=1\n) 
@@ -626,7 +629,7 @@ Gitea or set your environment appropriately.`, "")
626629	}
627630
628631	// 3. run hook 
629- 	resp , extra  :=  private .HookProcReceive (ctx , repoUser , repoName , hookOptions )
632+ 	resp , extra  :=  private .HookProcReceive (ctx , repoUser , repoName , groupID ,  hookOptions )
630633	if  extra .HasError () {
631634		return  fail (ctx , extra .UserMsg , "HookProcReceive failed: %v" , extra .Error )
632635	}
0 commit comments