summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_git16
2 files changed, 13 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index ef4b622e7..3e6f3e2e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-02-18 m0viefreak <m0viefreak.cm@googlemail.com>
+
+ * 32396: Completion/Unix/Command/_git: _git: fix
+ __git_committish_range_{first,last} and __git_is_committish_range
+
2014-02-17 Barton E. Schaefer <schaefer@zsh.org>
* unposted (users/18468): Doc/Zsh/builtins.yo, Doc/Zsh/params.yo:
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index c09f2555a..8562ab21a 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -4798,12 +4798,12 @@ __git_command_successful () {
(( $+functions[__git_committish_range_first] )) ||
__git_committish_range_first () {
- print -r -- ${1%..(.|)*}
+ print -r -- ${${${1%..*}%.}:-HEAD}
}
(( $+functions[__git_committish_range_last] )) ||
__git_committish_range_last () {
- print -r -- ${1##*..(.|)}
+ print -r -- ${${${1#*..}#.}:-HEAD}
}
(( $+functions[__git_pattern_escape] )) ||
@@ -4832,12 +4832,12 @@ __git_is_treeish () {
(( $+functions[__git_is_committish_range] )) ||
__git_is_committish_range () {
- # TODO: This isn't quite right. We would like to do parts=${(~s:..(.|))},
- # but that doesn't work. (This would allow us to make sure that parts only
- # contains two elements and then apply __git_is_committish on them.
- [[ $1 == *..(.|)* ]] &&
- __git_is_committish $(__git_committish_range_first $1) &&
- __git_is_committish $(__git_committish_range_last $1)
+ [[ $1 == *..(.|)* ]] || return 1
+ local first=$(__git_committish_range_first $1)
+ local last=$(__git_committish_range_last $1)
+ [[ $first != *..* && $last != *..* ]] && \
+ __git_is_committish $first && \
+ __git_is_committish $last
}
(( $+functions[__git_is_initial_commit] )) ||