summaryrefslogtreecommitdiff
path: root/etc/completions
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-06-19 20:11:49 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-06-19 20:11:49 +0200
commit092eef3d7b2365fd44258a2a81b9333b91aed7ae (patch)
treecb8100cfd9d8a2b39aebe74844a23fc4d4f38164 /etc/completions
parent30b638d22a2aa0515916488aec005ae61fd56ec2 (diff)
Remove custom __git_files hack
Diffstat (limited to 'etc/completions')
-rw-r--r--etc/completions/__git_files39
1 files changed, 0 insertions, 39 deletions
diff --git a/etc/completions/__git_files b/etc/completions/__git_files
deleted file mode 100644
index 062aefc..0000000
--- a/etc/completions/__git_files
+++ /dev/null
@@ -1,39 +0,0 @@
-#autoload
-local expl files ls_opts opts gitdir dirdiff i j prefix item self
-
-zparseopts -D -E -a opts -- -cached -deleted -modified -others -ignored -unmerged -killed
-
-gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
-__git_command_successful || return
-
-ls_opts=("--exclude-per-directory=.gitignore")
-[[ -f "${gitdir}/info/exclude" ]] && ls_opts+="--exclude-from=${gitdir}/info/exclude"
-
-files=(${(ps:\0:)"$(cd ${gitdir}/..; _call_program files git ls-files -z ${ls_opts} ${opts} 2>/dev/null)"})
-__git_command_successful || return
-
-if [[ -z ${gitdir} ]] {
- return 1
-}
-
-if [[ ! -d .git ]] {
- dirdiff=${PWD#${gitdir%/.git}/}
- for ((i = 1; i <= ${#files}; i++)) {
- prefix=''
- item=(${(s:/:)files[$i]})
- self=(${(s:/:)dirdiff})
- for ((j = 1; j <= ${#self}; j++)) {
- if [[ ${item[$j]} == ${self[$j]} ]] {
- item[$j]=''
- } else {
- prefix+='../'
- }
- }
- files[$i]=${prefix}
- for j in ${item}; {
- [[ -n ${j} ]] && files[$i]+="${j}/"
- }
- files[$i]=${files[$i]%/}
- }
-}
-_wanted files expl 'index file' _multi_parts ${@} - / files