@@ -55,19 +55,19 @@ func ProcReceive(ctx context.Context, repo *repo_model.Repository, gitRepo *git.
5555 }
5656
5757 baseBranchName := opts .RefFullNames [i ].ForBranchName ()
58- curentTopicBranch := ""
58+ currentTopicBranch := ""
5959 if ! gitRepo .IsBranchExist (baseBranchName ) {
6060 // try match refs/for/<target-branch>/<topic-branch>
6161 for p , v := range baseBranchName {
6262 if v == '/' && gitRepo .IsBranchExist (baseBranchName [:p ]) && p != len (baseBranchName )- 1 {
63- curentTopicBranch = baseBranchName [p + 1 :]
63+ currentTopicBranch = baseBranchName [p + 1 :]
6464 baseBranchName = baseBranchName [:p ]
6565 break
6666 }
6767 }
6868 }
6969
70- if len (topicBranch ) == 0 && len (curentTopicBranch ) == 0 {
70+ if len (topicBranch ) == 0 && len (currentTopicBranch ) == 0 {
7171 results = append (results , private.HookProcReceiveRefResult {
7272 OriginalRef : opts .RefFullNames [i ],
7373 OldOID : opts .OldCommitIDs [i ],
@@ -77,18 +77,18 @@ func ProcReceive(ctx context.Context, repo *repo_model.Repository, gitRepo *git.
7777 continue
7878 }
7979
80- if len (curentTopicBranch ) == 0 {
81- curentTopicBranch = topicBranch
80+ if len (currentTopicBranch ) == 0 {
81+ currentTopicBranch = topicBranch
8282 }
8383
8484 // because different user maybe want to use same topic,
8585 // So it's better to make sure the topic branch name
86- // has user name prefix
86+ // has username prefix
8787 var headBranch string
88- if ! strings .HasPrefix (curentTopicBranch , userName + "/" ) {
89- headBranch = userName + "/" + curentTopicBranch
88+ if ! strings .HasPrefix (currentTopicBranch , userName + "/" ) {
89+ headBranch = userName + "/" + currentTopicBranch
9090 } else {
91- headBranch = curentTopicBranch
91+ headBranch = currentTopicBranch
9292 }
9393
9494 pr , err := issues_model .GetUnmergedPullRequest (ctx , repo .ID , repo .ID , headBranch , baseBranchName , issues_model .PullRequestFlowAGit )
0 commit comments