Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove a change meant for another PR.
  • Loading branch information
chrisgavin committed Jun 14, 2022
commit c4a05147c00efd8842644f52e4ed733efc044b03
26 changes: 0 additions & 26 deletions internal/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,32 +246,6 @@ func (pushService *pushService) pushGit(repository *github.Repository, initialPu
Auth: credentials,
Progress: os.Stderr,
})
if err != nil && strings.Contains(err.Error(), "pre-receive hook declined") {
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.")
if len(refSpecs) == 1 && refSpecs[0].String() == defaultBrachRefSpec {
// todo
}
negativeRefSpecs := []config.RefSpec{}
for _, refSpec := range refSpecs {
negativeRefSpecs = append(negativeRefSpecs, config.RefSpec(":"+refSpec.Src()))
err = remote.PushContext(pushService.ctx, &git.PushOptions{
RefSpecs: negativeRefSpecs,
Auth: credentials,
Progress: os.Stderr,
})
if err != nil {
return errors.Wrap(err, "Error removing existing refs.")
}
err = remote.PushContext(pushService.ctx, &git.PushOptions{
RefSpecs: refSpecs,
Auth: credentials,
Progress: os.Stderr,
})
if err != nil && errors.Cause(err) != git.NoErrAlreadyUpToDate {
return errors.Wrap(err, "Error pushing Action to GitHub Enterprise Server.")
}
}
}
if err != nil && errors.Cause(err) != git.NoErrAlreadyUpToDate {
return errors.Wrap(err, "Error pushing Action to GitHub Enterprise Server.")
}
Expand Down