about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2007-09-25 17:58:50 +0000
committerClint Adams <clint@users.sourceforge.net>2007-09-25 17:58:50 +0000
commit9433977a83f67cab603922f2bfc3f65ee6e2a096 (patch)
tree3b07855836b59891f2661658b0bea1057f15e216
parentf24ab2ef9450c98c9bc512bfbebe348b6408f604 (diff)
downloadzsh-9433977a83f67cab603922f2bfc3f65ee6e2a096.tar.gz
zsh-9433977a83f67cab603922f2bfc3f65ee6e2a096.tar.xz
zsh-9433977a83f67cab603922f2bfc3f65ee6e2a096.zip
23831: fix handling of merge strategy option.
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_git14
2 files changed, 8 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 45bd9469e..64117ced5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-09-25  Clint Adams  <clint@zsh.org>
 
+	* 23831: Completion/Unix/Command/_git: fix handling of merge
+	strategy option.
+
 	* 23829: Completion/Unix/Command/_git: merge in the remaining
 	git completion changes from Nikolai Weibull's repository.
 
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 9ec2e3fe0..62b236189 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -92,10 +92,6 @@ fetch_args=(
   '-w[write commit-id into the filename under "$GIT_DIR/refs/<filename>"]:filename'
 )
 
-declare -g merge_strategy_arg
-
-merge_strategy_arg='*'{-s,--strategy=-}'[use given merge strategy]:merge strategy:__git_merge_strategies'
-
 declare -ga merge_args
 
 # TODO: Add descriptions to strategies (stupid is undocumented).
@@ -103,7 +99,7 @@ merge_args=(
   '(-n --no-summary)'{-n,--no-summary}'[do not show diffstat at the end of the merge]'
   '--no-commit[perform the merge but do not autocommit]'
   '--squash[merge, but do not make a commit]'
-  $merge_strategy_arg
+  '*'{-s,--strategy=-}'[use given merge strategy]:merge strategy:__git_merge_strategies'
 )
 
 declare -ga force_ref_arg
@@ -1666,7 +1662,7 @@ _git-ls-remote () {
 (( $+functions[_git-merge] )) ||
 _git-merge () {
   _arguments \
-    $merge_args \
+    "$merge_args[@]" \
     ':merge message' \
     '*:remote:__git_commits' && ret=0
 }
@@ -1689,7 +1685,7 @@ _git-octupus () {
 (( $+functions[_git-pull] )) ||
 _git-pull () {
   _arguments \
-    $merge_args \
+    "$merge_args[@]" \
     $common_fetch_args \
     ':repository:__git_any_repositories' \
     '*:refspec:__git_ref_specs' && ret=0
@@ -1725,7 +1721,7 @@ _git-rebase () {
       '--abort[abort current rebase]' \
       '--skip[skip the current patch]' \
       '--merge[use merging strategies to rebase]' \
-      $merge_strategy_arg \
+      '*'{-s,--strategy=-}'[use given merge strategy]:merge strategy:__git_merge_strategies' \
       $verbose_arg \
       '-C-[ensure that given lines of surrounding context match]: :_guard "[[\:digit\:]]##" "lines of context"' \
       ':upstream branch:__git_revisions' \
@@ -2310,7 +2306,7 @@ _git-svn () {
 
       if [[ $line[1] == (dcommit|rebase) ]]; then
         arguments+=(
-            $merge_strategy_arg)
+            '*'{-s,--strategy=-}'[use given merge strategy]:merge strategy:__git_merge_strategies')
       fi
 
       if [[ $line[1] == (dcommit|log|rebase) ]]; then