Skip to content

Commit

Permalink
Force Push (#2837)
Browse files Browse the repository at this point in the history
For the time being, use force when pushing to remote(s). Eventually
we'll implement conflict resolution but until deletion and conflict
resolution are supported, Force is a good way to avoid hard to recover
scenarios
  • Loading branch information
martinmaly committed Feb 28, 2022
1 parent e0bd1ed commit 24faa46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions porch/repository/pkg/git/draft.go
Expand Up @@ -115,10 +115,10 @@ func (d *gitPackageDraft) Close(ctx context.Context) (repository.PackageRevision
}

if err := d.parent.repo.Push(&git.PushOptions{
RemoteName: "origin",
RefSpecs: []config.RefSpec{refSpec},
Auth: auth,
RequireRemoteRefs: []config.RefSpec{},
RemoteName: "origin",
RefSpecs: []config.RefSpec{refSpec},
Auth: auth,
Force: true, // TODO: implement conflict recovery.
}); err != nil {
return nil, fmt.Errorf("failed to push to git: %w", err)
}
Expand Down

0 comments on commit 24faa46

Please sign in to comment.