mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-11-12 22:10:54 +01:00
38129: _git: Fix __git_ignore_line's treatment of shell and pattern metacaracters.
Builds upon a patch by Jun T. Also upgrade/fix __git_pattern_escape.
This commit is contained in:
parent
98fcdb0861
commit
527badc237
2 changed files with 8 additions and 3 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2016-03-11 Daniel Shahaf <d.s@daniel.shahaf.name>
|
||||
|
||||
* 38129: Completion/Unix/Command/_git: Fix __git_ignore_line's
|
||||
treatment of shell and pattern metacaracters.
|
||||
|
||||
2016-03-10 Daniel Shahaf <d.s@daniel.shahaf.name>
|
||||
|
||||
* 38128: Completion/Unix/Command/_git: Fix completion of diffs
|
||||
|
|
|
|||
|
|
@ -4956,7 +4956,7 @@ __git_committish_range_last () {
|
|||
|
||||
(( $+functions[__git_pattern_escape] )) ||
|
||||
__git_pattern_escape () {
|
||||
print -r -n ${1//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}
|
||||
print -r -n - ${(b)1}
|
||||
}
|
||||
|
||||
(( $+functions[__git_is_type] )) ||
|
||||
|
|
@ -5048,9 +5048,9 @@ __git_ignore_line () {
|
|||
declare -a ignored
|
||||
ignored=()
|
||||
((CURRENT > 1)) &&
|
||||
ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
|
||||
ignored+=(${(bQ)line[1,CURRENT-1]})
|
||||
((CURRENT < $#line)) &&
|
||||
ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
|
||||
ignored+=(${(bQ)line[CURRENT+1,-1]})
|
||||
$* -F ignored
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue