From d452490489e59c07392f3d5a9b05d8c9e7c64ec1 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Mon, 15 Jul 2013 11:53:27 +0200 Subject: [PATCH] Merge https://github.com/robbyrussell/oh-my-zsh/pull/1961 Signed-off-by: Gaetan Semet --- plugins/git/_git-branch | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/plugins/git/_git-branch b/plugins/git/_git-branch index 86d03bc30..6b9c1a483 100644 --- a/plugins/git/_git-branch +++ b/plugins/git/_git-branch @@ -60,3 +60,24 @@ _git-branch () "($l $c $m -d)-D[delete a branch]" \ $dependent_deletion_args } + +(( $+functions[__git_ignore_line] )) || +__git_ignore_line () { + declare -a ignored + ignored=() + ((CURRENT > 1)) && + ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) + ((CURRENT < $#line)) && + ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) + $* -F ignored +} + +(( $+functions[__git_ignore_line_inside_arguments] )) || +__git_ignore_line_inside_arguments () { + declare -a compadd_opts + + zparseopts -D -E -a compadd_opts V: J: 1 2 n f X: M: P: S: r: R: q F: + + __git_ignore_line $* $compadd_opts +} +