File tree Expand file tree Collapse file tree 1 file changed +0
-26
lines changed Expand file tree Collapse file tree 1 file changed +0
-26
lines changed Original file line number Diff line number Diff line change @@ -246,32 +246,6 @@ func (pushService *pushService) pushGit(repository *github.Repository, initialPu
246
246
Auth : credentials ,
247
247
Progress : os .Stderr ,
248
248
})
249
- if err != nil && strings .Contains (err .Error (), "pre-receive hook declined" ) {
250
- log .Warn ("Push was rejected by a pre-receive hook. This may be because force-pushing is not allowed. Will try and remove and recreate the branch." )
251
- if len (refSpecs ) == 1 && refSpecs [0 ].String () == defaultBrachRefSpec {
252
- // todo
253
- }
254
- negativeRefSpecs := []config.RefSpec {}
255
- for _ , refSpec := range refSpecs {
256
- negativeRefSpecs = append (negativeRefSpecs , config .RefSpec (":" + refSpec .Src ()))
257
- err = remote .PushContext (pushService .ctx , & git.PushOptions {
258
- RefSpecs : negativeRefSpecs ,
259
- Auth : credentials ,
260
- Progress : os .Stderr ,
261
- })
262
- if err != nil {
263
- return errors .Wrap (err , "Error removing existing refs." )
264
- }
265
- err = remote .PushContext (pushService .ctx , & git.PushOptions {
266
- RefSpecs : refSpecs ,
267
- Auth : credentials ,
268
- Progress : os .Stderr ,
269
- })
270
- if err != nil && errors .Cause (err ) != git .NoErrAlreadyUpToDate {
271
- return errors .Wrap (err , "Error pushing Action to GitHub Enterprise Server." )
272
- }
273
- }
274
- }
275
249
if err != nil && errors .Cause (err ) != git .NoErrAlreadyUpToDate {
276
250
return errors .Wrap (err , "Error pushing Action to GitHub Enterprise Server." )
277
251
}
You can’t perform that action at this time.
0 commit comments