summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-04-25 13:29:02 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-04-25 13:29:02 +0900
commit3a940e90d505a3f2ea20e5ebc5b7acad131ad204 (patch)
treeef6cbbb43157957be682aeb8edc13cf66f650fea
parentMerge branch 'es/worktree-docs' (diff)
parentcompletion: improve ls-files filter performance (diff)
downloadtgif-3a940e90d505a3f2ea20e5ebc5b7acad131ad204.tar.xz
Merge branch 'cb/bash-completion-ls-files-processing'
Shell completion (in contrib) that gives list of paths have been optimized somewhat. * cb/bash-completion-ls-files-processing: completion: improve ls-files filter performance
-rw-r--r--contrib/completion/git-completion.bash7
1 files changed, 1 insertions, 6 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index a757073945..01dd9ff07a 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -390,12 +390,7 @@ __git_index_files ()
local root="${2-.}" file
__git_ls_files_helper "$root" "$1" |
- while read -r file; do
- case "$file" in
- ?*/*) echo "${file%%/*}" ;;
- *) echo "$file" ;;
- esac
- done | sort | uniq
+ cut -f1 -d/ | sort | uniq
}
# Lists branches from the local repository.