summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
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 7dc6cd8eb8..7ef7385d12 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -3268,9 +3268,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')"
}