From 587dd4d7977de452f53531ba9f063bbc0c083006 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Fri, 15 May 2020 08:09:27 -0700 Subject: [PATCH] a better name --- command/pr.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/command/pr.go b/command/pr.go index 6de1e3640..8b0ed32ec 100644 --- a/command/pr.go +++ b/command/pr.go @@ -481,21 +481,21 @@ func prMerge(cmd *cobra.Command, args []string) error { } // Ensure only one merge method is specified - flagCount := 0 + enabledFlagCount := 0 isInteractive := false if b, _ := cmd.Flags().GetBool("merge"); b { - flagCount++ + enabledFlagCount++ } if b, _ := cmd.Flags().GetBool("rebase"); b { - flagCount++ + enabledFlagCount++ } if b, _ := cmd.Flags().GetBool("squash"); b { - flagCount++ + enabledFlagCount++ } - if flagCount == 0 { + if enabledFlagCount == 0 { isInteractive = true - } else if flagCount > 1 { + } else if enabledFlagCount > 1 { return errors.New("expected exactly one of --merge, --rebase, or --squash to be true") }