summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Theisen <brent@bantamlabs.com>2013-07-09 23:15:43 -0500
committerBrent Theisen <brent@bantamlabs.com>2013-07-09 23:15:43 -0500
commit05d8fdf3d54af3243e5891d13969a766bd9570a1 (patch)
tree7214d166eff960af42ca399e9fd3cdcd6741af90
parent7f74294d7aa7ab86e18e70a1153c15fa373c5849 (diff)
downloadzsh-05d8fdf3d54af3243e5891d13969a766bd9570a1.tar.gz
zsh-05d8fdf3d54af3243e5891d13969a766bd9570a1.tar.bz2
zsh-05d8fdf3d54af3243e5891d13969a766bd9570a1.zip
Copy and paste of two functions from Ubuntu 13.04's version of /usr/share/zsh/functions/Completion/Unix/_git that were referenced in 46f0d8d. Fixes #1952.
-rw-r--r--plugins/git/_git-branch21
1 files changed, 21 insertions, 0 deletions
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
+}
+