Add changes to an existing changeset By default the operation will fail in case of conflicts, for instance a file modified in both changesets. The behavior can be adjusted using onConflict argument
(changes *Changeset, opts ...ChangesetWithChangesetOpts)
| 1294 | // |
| 1295 | // By default the operation will fail in case of conflicts, for instance a file modified in both changesets. The behavior can be adjusted using onConflict argument |
| 1296 | func (r *Changeset) WithChangeset(changes *Changeset, opts ...ChangesetWithChangesetOpts) *Changeset { |
| 1297 | assertNotNil("changes", changes) |
| 1298 | q := r.query.Select("withChangeset") |
| 1299 | for i := len(opts) - 1; i >= 0; i-- { |
| 1300 | // `onConflict` optional argument |
| 1301 | if !querybuilder.IsZeroValue(opts[i].OnConflict) { |
| 1302 | q = q.Arg("onConflict", opts[i].OnConflict) |
| 1303 | } |
| 1304 | } |
| 1305 | q = q.Arg("changes", changes) |
| 1306 | |
| 1307 | return &Changeset{ |
| 1308 | query: q, |
| 1309 | } |
| 1310 | } |
| 1311 | |
| 1312 | // ChangesetWithChangesetsOpts contains options for Changeset.WithChangesets |
| 1313 | type ChangesetWithChangesetsOpts struct { |
nothing calls this directly
no test coverage detected