Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
feat mr: remove prefix in ID of MR just like Issue
Browse files Browse the repository at this point in the history
This change

- improves consistency of APIs.
- is copied from: https://github.com/profclems/glab/blob/0232a0c0791374ef5c1fa2072582a7127126b078/commands/issue/issueutils/utils.go#L106
- makes pipes easier
    - e.g., `glab mr list | fzf | grep -oE "^\S+" | glab mr view`
    - this is what atusy/ghf internally does

Finishes #789
  • Loading branch information
atusy committed Jul 13, 2021
1 parent 0232a0c commit 5ec0110
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commands/mr/mrutils/mrutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func MRFromArgsWithOpts(
var branch string

if len(args) > 0 {
mrID, err = strconv.Atoi(args[0])
mrID, err = strconv.Atoi(strings.TrimPrefix(args[0], "!"))
if err != nil {
branch = args[0]
} else if mrID == 0 { // to check for cases where the user explicitly specified mrID to be zero
Expand Down

0 comments on commit 5ec0110

Please sign in to comment.