diff options
author | Alex <SendingMoreTrains@gmail.com> | 2023-01-09 13:30:08 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-09 19:30:08 +0000 |
commit | 9f31951019401449e057a236886d133f58c5cc64 (patch) | |
tree | 2718cd77d0ac16d242edebf24b7cc2590b5f3676 | |
parent | bc36043e8f004e130df7dc2f4708e2313e400bff (diff) | |
download | zsh-9f31951019401449e057a236886d133f58c5cc64.tar.gz zsh-9f31951019401449e057a236886d133f58c5cc64.tar.bz2 zsh-9f31951019401449e057a236886d133f58c5cc64.zip |
fix(jira): Make prefix check on "jira branch" command case-insensitive (#8799)
* Make prefix check on "jira branch" command case-insensitive
* Update plugins/jira/jira.plugin.zsh
Co-authored-by: Marc Cornellà <hello@mcornella.com>
* Fixing tabs to spaces
Co-authored-by: Robby Russell <robby@planetargon.com>
Co-authored-by: Marc Cornellà <hello@mcornella.com>
-rw-r--r-- | plugins/jira/README.md | 5 | ||||
-rw-r--r-- | plugins/jira/jira.plugin.zsh | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/plugins/jira/README.md b/plugins/jira/README.md index a5633af77..f8751aaa2 100644 --- a/plugins/jira/README.md +++ b/plugins/jira/README.md @@ -27,6 +27,11 @@ jira branch # opens an existing issue matching the current branch name # The branch name may have prefixes ending in "/": "feature/MP-1234", # and also suffixes starting with "_": "MP-1234_fix_dashboard" # In both these cases, the issue opened will be "MP-1234" + # This is also checks if the prefix is in the name, and adds it if not, so: + # "MP-1234" opens the issue "MP-1234", + # "mp-1234" opens the issue "mp-1234", + # and "1234" opens the issue "MP-1234". +# NOTE: since jira is case insensitive, the first two examples open the same issue jira ABC-123 # opens an existing issue jira ABC-123 m # opens an existing issue for adding a comment ``` diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh index 22807e0ae..37d7b6a27 100644 --- a/plugins/jira/jira.plugin.zsh +++ b/plugins/jira/jira.plugin.zsh @@ -75,7 +75,7 @@ function jira() { # Strip suffixes starting with _ issue_arg=(${(s:_:)issue_arg}) issue_arg=${issue_arg[1]} - if [[ "$issue_arg" = ${jira_prefix}* ]]; then + if [[ "${issue_arg:l}" = ${jira_prefix:l}* ]]; then issue="${issue_arg}" else issue="${jira_prefix}${issue_arg}" |