diff options
Diffstat (limited to 'Completion')
| -rw-r--r-- | Completion/Unix/Command/_git | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 95bd3096d..7c7b0d764 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -8520,7 +8520,7 @@ __git_worktrees () { hash=${${${"${(f)i}"[2]}#HEAD }[1,9]} branch=${${"${(f)i}"[3]}#branch refs/heads/} - # Simulate the non-porcelain output + # Simulate the non-porcelain output of `git worktree list` if [[ $branch == detached ]]; then # TODO: show a ref that points at $hash here, like vcs_info does? branch="(detached HEAD)" @@ -8531,7 +8531,8 @@ __git_worktrees () { descriptions+=( "${directories[-1]//(#b)([\\:])/\\${match[1]}}":"$hash $branch" ) done - _describe -t directories 'working tree' descriptions -S ' ' -f -M 'r:|/=* r:|=*' + # Use -V so the order matches the output of `git worktree list`. + _describe -V -t directories 'working tree' descriptions -S ' ' -f -M 'r:|/=* r:|=*' } (( $+functions[__git_difftools] )) || |
