Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/util: fix error handling for parseArgsWithGitBranchMR
The parse logic to get the MR ID from remote and/or branch name was kinda confusing: 1) the variable names were non-obvious 2) the error code was being ignored because it was being used as part of the logic itself: it was fine to fail. However, after the commit 69ae19e ("cmd: fix return value checks and statements") was introduced, the error handling broke the logic. To make things clearer and also to fix the breakage, this patch changed the variable names and considered the error returning value to make sure we can safely return with a valid ID value (in case the actual MR ID was used and not the remote and/or branch name). It's a soft revert of the commit 69ae19e ("cmd: fix return value checks and statements") in this specific codepath, but still avoids golint complaining about an error returning value being ignored. Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
- Loading branch information