@@ -97,11 +97,7 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor
97
97
return fmt .Errorf ("git remote add [%s -> %s]: %s" , baseGitRepo .Path , tmpBasePath , errbuf .String ())
98
98
}
99
99
100
- if err := git .NewCommand ("fetch" , "origin" , pr .BaseBranch + ":" + baseBranch ).RunInDirPipeline (tmpBasePath , nil , & errbuf ); err != nil {
101
- return fmt .Errorf ("git fetch [%s -> %s]: %s" , headRepoPath , tmpBasePath , errbuf .String ())
102
- }
103
-
104
- if err := git .NewCommand ("fetch" , "origin" , pr .BaseBranch + ":original_" + baseBranch ).RunInDirPipeline (tmpBasePath , nil , & errbuf ); err != nil {
100
+ if err := git .NewCommand ("fetch" , "origin" , "--no-tags" , pr .BaseBranch + ":" + baseBranch , pr .BaseBranch + ":original_" + baseBranch ).RunInDirPipeline (tmpBasePath , nil , & errbuf ); err != nil {
105
101
return fmt .Errorf ("git fetch [%s -> %s]: %s" , headRepoPath , tmpBasePath , errbuf .String ())
106
102
}
107
103
@@ -119,7 +115,7 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor
119
115
120
116
trackingBranch := "tracking"
121
117
// Fetch head branch
122
- if err := git .NewCommand ("fetch" , remoteRepoName , pr .HeadBranch + ":" + trackingBranch ).RunInDirPipeline (tmpBasePath , nil , & errbuf ); err != nil {
118
+ if err := git .NewCommand ("fetch" , "--no-tags" , remoteRepoName , pr .HeadBranch + ":" + trackingBranch ).RunInDirPipeline (tmpBasePath , nil , & errbuf ); err != nil {
123
119
return fmt .Errorf ("git fetch [%s -> %s]: %s" , headRepoPath , tmpBasePath , errbuf .String ())
124
120
}
125
121
@@ -192,11 +188,11 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor
192
188
return fmt .Errorf ("git checkout: %s" , errbuf .String ())
193
189
}
194
190
// Rebase before merging
195
- if err := git .NewCommand ("rebase" , "-q" , pr . BaseBranch ).RunInDirPipeline (tmpBasePath , nil , & errbuf ); err != nil {
191
+ if err := git .NewCommand ("rebase" , "-q" , baseBranch ).RunInDirPipeline (tmpBasePath , nil , & errbuf ); err != nil {
196
192
return fmt .Errorf ("git rebase [%s -> %s]: %s" , headRepoPath , tmpBasePath , errbuf .String ())
197
193
}
198
194
// Checkout base branch again
199
- if err := git .NewCommand ("checkout" , pr . BaseBranch ).RunInDirPipeline (tmpBasePath , nil , & errbuf ); err != nil {
195
+ if err := git .NewCommand ("checkout" , baseBranch ).RunInDirPipeline (tmpBasePath , nil , & errbuf ); err != nil {
200
196
return fmt .Errorf ("git checkout: %s" , errbuf .String ())
201
197
}
202
198
// Merge fast forward
@@ -209,11 +205,11 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor
209
205
return fmt .Errorf ("git checkout: %s" , errbuf .String ())
210
206
}
211
207
// Rebase before merging
212
- if err := git .NewCommand ("rebase" , "-q" , pr . BaseBranch ).RunInDirPipeline (tmpBasePath , nil , & errbuf ); err != nil {
208
+ if err := git .NewCommand ("rebase" , "-q" , baseBranch ).RunInDirPipeline (tmpBasePath , nil , & errbuf ); err != nil {
213
209
return fmt .Errorf ("git rebase [%s -> %s]: %s" , headRepoPath , tmpBasePath , errbuf .String ())
214
210
}
215
211
// Checkout base branch again
216
- if err := git .NewCommand ("checkout" , pr . BaseBranch ).RunInDirPipeline (tmpBasePath , nil , & errbuf ); err != nil {
212
+ if err := git .NewCommand ("checkout" , baseBranch ).RunInDirPipeline (tmpBasePath , nil , & errbuf ); err != nil {
217
213
return fmt .Errorf ("git checkout: %s" , errbuf .String ())
218
214
}
219
215
// Prepare merge with commit
0 commit comments