Skip to content

Commit

Permalink
Remove redundant on-tags argument from list-diff
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rymuszka committed Jun 8, 2022
1 parent 997668e commit ca01361
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions pkg/cli/list_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ var listDiffCmd = &cobra.Command{
defaultBranch := fetchOptionalStringFlag(cmd, "default-branch")
defaultRange := fetchOptionalStringFlag(cmd, "default-range")
branchRange := fetchOptionalStringFlag(cmd, "branch-range")
onTags := fetchOptionalBoolFlag(cmd, "on-tags")

gitDiffSet := git.NewDiffSet(defaultBranch, defaultRange, branchRange, onTags)
gitDiffSet := git.NewDiffSet(defaultBranch, defaultRange, branchRange, true)

if gitDiffSet.IsEvaluationNeeded() {
println("Listing diffs for tags is not supported.")
Expand Down Expand Up @@ -60,7 +59,6 @@ func init() {
listDiffCmd.Flags().String("default-branch", "", "default branch of repository")
listDiffCmd.Flags().String("default-range", "", "default range for evaluation")
listDiffCmd.Flags().String("branch-range", "", "branch range for evaluation")
listDiffCmd.Flags().Bool("on-tags", true, "if commands is running on tags")

rootCmd.AddCommand(listDiffCmd)
}
2 changes: 1 addition & 1 deletion test/e2e/list_diff_on_tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

assert_eq($?.exitstatus, 0)
assert_eq([], output)
assert_eq(["Running on a tag, skipping evaluation."], error)
assert_eq(["Listing diffs for tags is not supported."], error)

repo.run(%{
export SEMAPHORE_GIT_REF_TYPE=branch
Expand Down

0 comments on commit ca01361

Please sign in to comment.