Skip to content

Commit

Permalink
fix: ocm transfer ignored --enforce when --overwrite is set (#1187)
Browse files Browse the repository at this point in the history
<!-- markdownlint-disable MD041 -->
#### What this PR does / why we need it
Fixes a bug in the `ocm transfer` command, that caused the `--enforce`
option to be ignored if `--overwrite` was set.

#### Which issue(s) this PR fixes
<!--
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
#1186
  • Loading branch information
fabianburth authored Dec 13, 2024
1 parent e290d01 commit 34064e7
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ versions are re-transported).

func (o *Option) ApplyTransferOption(opts transferhandler.TransferOptions) error {
if (o.overwrite != nil && o.overwrite.Changed) || o.Overwrite {
return standard.Overwrite(o.Overwrite).ApplyTransferOption(opts)
if err := standard.Overwrite(o.Overwrite).ApplyTransferOption(opts); err != nil {
return err
}
}
if (o.enforce != nil && o.enforce.Changed) || o.EnforceTransport {
return standard.EnforceTransport(o.EnforceTransport).ApplyTransferOption(opts)
if err := standard.EnforceTransport(o.EnforceTransport).ApplyTransferOption(opts); err != nil {
return err
}
}
return nil
}

0 comments on commit 34064e7

Please sign in to comment.