@@ -182,6 +182,7 @@ Gitea or set your environment appropriately.`, "")
182182 // the environment is set by serv command
183183 isWiki , _ := strconv .ParseBool (os .Getenv (repo_module .EnvRepoIsWiki ))
184184 username := os .Getenv (repo_module .EnvRepoUsername )
185+ groupID , _ := strconv .ParseInt (os .Getenv (repo_module .EnvRepoGroupID ), 10 , 64 )
185186 reponame := os .Getenv (repo_module .EnvRepoName )
186187 userID , _ := strconv .ParseInt (os .Getenv (repo_module .EnvPusherID ), 10 , 64 )
187188 prID , _ := strconv .ParseInt (os .Getenv (repo_module .EnvPRID ), 10 , 64 )
@@ -255,7 +256,7 @@ Gitea or set your environment appropriately.`, "")
255256 hookOptions .OldCommitIDs = oldCommitIDs
256257 hookOptions .NewCommitIDs = newCommitIDs
257258 hookOptions .RefFullNames = refFullNames
258- extra := private .HookPreReceive (ctx , username , reponame , hookOptions )
259+ extra := private .HookPreReceive (ctx , username , reponame , groupID , hookOptions )
259260 if extra .HasError () {
260261 return fail (ctx , extra .UserMsg , "HookPreReceive(batch) failed: %v" , extra .Error )
261262 }
@@ -278,7 +279,7 @@ Gitea or set your environment appropriately.`, "")
278279
279280 fmt .Fprintf (out , " Checking %d references\n " , count )
280281
281- extra := private .HookPreReceive (ctx , username , reponame , hookOptions )
282+ extra := private .HookPreReceive (ctx , username , reponame , groupID , hookOptions )
282283 if extra .HasError () {
283284 return fail (ctx , extra .UserMsg , "HookPreReceive(last) failed: %v" , extra .Error )
284285 }
@@ -351,6 +352,7 @@ Gitea or set your environment appropriately.`, "")
351352 pusherID , _ := strconv .ParseInt (os .Getenv (repo_module .EnvPusherID ), 10 , 64 )
352353 prID , _ := strconv .ParseInt (os .Getenv (repo_module .EnvPRID ), 10 , 64 )
353354 pusherName := os .Getenv (repo_module .EnvPusherName )
355+ groupID , _ := strconv .ParseInt (os .Getenv (repo_module .EnvRepoGroupID ), 10 , 64 )
354356
355357 hookOptions := private.HookOptions {
356358 UserName : pusherName ,
@@ -400,7 +402,7 @@ Gitea or set your environment appropriately.`, "")
400402 hookOptions .OldCommitIDs = oldCommitIDs
401403 hookOptions .NewCommitIDs = newCommitIDs
402404 hookOptions .RefFullNames = refFullNames
403- resp , extra := private .HookPostReceive (ctx , repoUser , repoName , hookOptions )
405+ resp , extra := private .HookPostReceive (ctx , repoUser , repoName , groupID , hookOptions )
404406 if extra .HasError () {
405407 _ = dWriter .Close ()
406408 hookPrintResults (results )
@@ -415,7 +417,7 @@ Gitea or set your environment appropriately.`, "")
415417 if count == 0 {
416418 if wasEmpty && masterPushed {
417419 // We need to tell the repo to reset the default branch to master
418- extra := private .SetDefaultBranch (ctx , repoUser , repoName , "master" )
420+ extra := private .SetDefaultBranch (ctx , repoUser , repoName , groupID , "master" )
419421 if extra .HasError () {
420422 return fail (ctx , extra .UserMsg , "SetDefaultBranch failed: %v" , extra .Error )
421423 }
@@ -433,7 +435,7 @@ Gitea or set your environment appropriately.`, "")
433435
434436 fmt .Fprintf (out , " Processing %d references\n " , count )
435437
436- resp , extra := private .HookPostReceive (ctx , repoUser , repoName , hookOptions )
438+ resp , extra := private .HookPostReceive (ctx , repoUser , repoName , groupID , hookOptions )
437439 if resp == nil {
438440 _ = dWriter .Close ()
439441 hookPrintResults (results )
@@ -446,7 +448,7 @@ Gitea or set your environment appropriately.`, "")
446448
447449 if wasEmpty && masterPushed {
448450 // We need to tell the repo to reset the default branch to master
449- extra := private .SetDefaultBranch (ctx , repoUser , repoName , "master" )
451+ extra := private .SetDefaultBranch (ctx , repoUser , repoName , groupID , "master" )
450452 if extra .HasError () {
451453 return fail (ctx , extra .UserMsg , "SetDefaultBranch failed: %v" , extra .Error )
452454 }
@@ -514,6 +516,7 @@ Gitea or set your environment appropriately.`, "")
514516 repoName := os .Getenv (repo_module .EnvRepoName )
515517 pusherID , _ := strconv .ParseInt (os .Getenv (repo_module .EnvPusherID ), 10 , 64 )
516518 pusherName := os .Getenv (repo_module .EnvPusherName )
519+ groupID , _ := strconv .ParseInt (os .Getenv (repo_module .EnvRepoGroupID ), 10 , 64 )
517520
518521 // 1. Version and features negotiation.
519522 // S: PKT-LINE(version=1\0push-options atomic...) / PKT-LINE(version=1\n)
@@ -627,7 +630,7 @@ Gitea or set your environment appropriately.`, "")
627630 }
628631
629632 // 3. run hook
630- resp , extra := private .HookProcReceive (ctx , repoUser , repoName , hookOptions )
633+ resp , extra := private .HookProcReceive (ctx , repoUser , repoName , groupID , hookOptions )
631634 if extra .HasError () {
632635 return fail (ctx , extra .UserMsg , "HookProcReceive failed: %v" , extra .Error )
633636 }
0 commit comments