summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2015-05-13 15:06:05 +0200
committerDaniel Hahler <git@thequod.de>2015-05-18 02:48:03 +0200
commit1d5b2254988ceeca2a2a04db2e77733f265afbd2 (patch)
tree352880479eeff5bf4761287bd6fc247c4c4887c4 /Completion/Unix
parentb6404e18c0a391365e319141b6b59b4f0280f90b (diff)
downloadzsh-1d5b2254988ceeca2a2a04db2e77733f265afbd2.tar.gz
zsh-1d5b2254988ceeca2a2a04db2e77733f265afbd2.tar.xz
zsh-1d5b2254988ceeca2a2a04db2e77733f265afbd2.zip
35100: __git_recent_commits: massage ' ->*' from heads
Handle " -> master, origin/master" in decorated git-log output, and add
it as separate entries.
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Command/_git2
1 files changed, 2 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index d9d1015c3..92835387d 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5666,6 +5666,7 @@ __git_recent_commits () {
   local i j k
 
   # Careful: most %d will expand to the empty string.  Quote properly!
+  # NOTE: we could use %D directly, but it's not available in git 1.9.1 at least.
   : "${(A)commits::=${(@f)"$(_call_program commits git --no-pager log -20 --format='%h%n%d%n%s')"}}"
   __git_command_successful $pipestatus || return 1
 
@@ -5674,6 +5675,7 @@ __git_recent_commits () {
     # see workers/34768
     descr+=("$i:[$i] $k")
     j=${${j# \(}%\)} # strip leading ' (' and trailing ')'
+    j=${j/ ->/,}  # Convert " -> master, origin/master".
     for j in ${(s:, :)j}; do
       if [[ $j == 'tag: '* ]] ; then
         tags+=( ${j#tag: } )