Skip to content

Commit 8b9ff4d

Browse files
committed
-
1 parent 479fc0e commit 8b9ff4d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

fix/gitlab_fix_main.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ func (t *FixParams) GitlabFix() (PrUrl string, preview []Preview, err error) {
3333
if err != nil {
3434
return
3535
}
36-
exist, existErr := CheckBranchExist(ctx, repoPath, t.Branch)
37-
if existErr != nil && existErr.Error() != "无法获得检测分支" {
38-
err = existErr
39-
return
40-
}
41-
if exist {
42-
defBranch = t.Branch
36+
if defBranch != t.Branch {
37+
exist, existErr := CheckBranchExist(ctx, repoPath, t.Branch)
38+
if existErr != nil && existErr.Error() != "无法获得检测分支" {
39+
err = existErr
40+
return
41+
}
42+
if exist {
43+
defBranch = t.Branch
44+
}
4345
}
4446
// 设置git邮箱和用户名
4547
_, err = RunGitCommand(ctx, repoPath, "git", "config", "user.email", t.UserEmail)

0 commit comments

Comments
 (0)