summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-05-07 12:47:42 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-05-07 12:47:42 +0900
commit70a890d42f6c8cb7c0bb2c10361857621c821195 (patch)
treececf307288a9d5e86875926a0ab3fc0dda990166 /contrib
parentMerge branch 'dl/complete-stash-updates' (diff)
parentwork around zsh comment in __git_complete_worktree_paths (diff)
downloadtgif-70a890d42f6c8cb7c0bb2c10361857621c821195.tar.xz
Merge branch 'si/zsh-complete-comment-fix'
Portability fix for command line completion script (in contrib/). * si/zsh-complete-comment-fix: work around zsh comment in __git_complete_worktree_paths
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-completion.bash5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index b09cb62c9f..5722ef07aa 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -3250,9 +3250,10 @@ _git_whatchanged ()
__git_complete_worktree_paths ()
{
local IFS=$'\n'
+ # Generate completion reply from worktree list skipping the first
+ # entry: it's the path of the main worktree, which can't be moved,
+ # removed, locked, etc.
__gitcomp_nl "$(git worktree list --porcelain |
- # Skip the first entry: it's the path of the main worktree,
- # which can't be moved, removed, locked, etc.
sed -n -e '2,$ s/^worktree //p')"
}