summaryrefslogtreecommitdiff
path: root/contrib/completion/git-completion.bash
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-05-07 03:47:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-05-07 03:47:42 (GMT)
commit70a890d42f6c8cb7c0bb2c10361857621c821195 (patch)
treececf307288a9d5e86875926a0ab3fc0dda990166 /contrib/completion/git-completion.bash
parent18e1ba10927b15f66a32c86f61133e9adf79f9cf (diff)
parentf2acf763e29a3696fef268a9e8dc421e807df7f2 (diff)
downloadgit-70a890d42f6c8cb7c0bb2c10361857621c821195.zip
git-70a890d42f6c8cb7c0bb2c10361857621c821195.tar.gz
git-70a890d42f6c8cb7c0bb2c10361857621c821195.tar.bz2
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/completion/git-completion.bash')
-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 b09cb62..5722ef0 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')"
}