Skip to content

Commit

Permalink
Add missing arg length check to fix runtime panic on "repo branch del…
Browse files Browse the repository at this point in the history
…ete <reponame>" command with missing branch arg
  • Loading branch information
x2 committed Sep 1, 2024
1 parent be5d8aa commit 41d246c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/ssh/cmd/branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func branchDeleteCommand() *cobra.Command {
Use: "delete REPOSITORY BRANCH",
Aliases: []string{"remove", "rm", "del"},
Short: "Delete a branch",
Args: cobra.ExactArgs(2),

Check failure on line 151 in pkg/ssh/cmd/branch.go

View workflow job for this annotation

GitHub Actions / lint-soft

Magic number: 2, in <argument> detected (mnd)
PersistentPreRunE: checkIfCollab,
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
Expand Down

0 comments on commit 41d246c

Please sign in to comment.