Skip to content

Commit

Permalink
extra options should only be applied to the second stage
Browse files Browse the repository at this point in the history
  • Loading branch information
z4yx committed Mar 14, 2020
1 parent 07cb510 commit b25be80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions worker/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ exit 0
fmt.Sprintf(
"-aHvh --no-o --no-g --stats --exclude .~tmp~/ --safe-links "+
"--timeout=120 --contimeout=120 --exclude dists/ -6 "+
"--exclude-from %s --delete-excluded --cache %s %s",
"--exclude-from %s %s %s",
provider.excludeFile, provider.upstreamURL, provider.WorkingDir(),
),
targetDir,
Expand Down Expand Up @@ -497,7 +497,7 @@ exit 0
expectedOutput := fmt.Sprintf(
"-aHvh --no-o --no-g --stats --exclude .~tmp~/ --safe-links "+
"--timeout=120 --contimeout=120 --exclude dists/ -6 "+
"--exclude-from %s --delete-excluded --cache %s %s\n",
"--exclude-from %s %s %s\n",
provider.excludeFile, provider.upstreamURL, provider.WorkingDir(),
)

Expand Down
6 changes: 3 additions & 3 deletions worker/two_stage_rsync_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ func (p *twoStageRsyncProvider) Options(stage int) ([]string, error) {

} else if stage == 2 {
options = append(options, p.stage2Options...)
if p.extraOptions != nil {
options = append(options, p.extraOptions...)
}
} else {
return []string{}, fmt.Errorf("Invalid stage: %d", stage)
}
Expand All @@ -117,9 +120,6 @@ func (p *twoStageRsyncProvider) Options(stage int) ([]string, error) {
if p.excludeFile != "" {
options = append(options, "--exclude-from", p.excludeFile)
}
if p.extraOptions != nil {
options = append(options, p.extraOptions...)
}

return options, nil
}
Expand Down

0 comments on commit b25be80

Please sign in to comment.