summaryrefslogtreecommitdiff
path: root/etc/completions/__git_files
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-04-02 11:32:38 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-04-02 11:32:38 +0200
commitf0f3c02a3ccde07d3dc79577c7eca41ea3e8e86f (patch)
treed0aaab1de872a30a94555d2da3b501e13e18c217 /etc/completions/__git_files
parent81ac4a06bff278f07620804b7d4120342b1f6522 (diff)
Replace $var by ${var}
Diffstat (limited to 'etc/completions/__git_files')
-rw-r--r--etc/completions/__git_files16
1 files changed, 8 insertions, 8 deletions
diff --git a/etc/completions/__git_files b/etc/completions/__git_files
index 44be686..062aefc 100644
--- a/etc/completions/__git_files
+++ b/etc/completions/__git_files
@@ -7,33 +7,33 @@ 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"
+[[ -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)"})
+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 ]] {
+if [[ -z ${gitdir} ]] {
return 1
}
if [[ ! -d .git ]] {
dirdiff=${PWD#${gitdir%/.git}/}
- for ((i = 1; i <= $#files; i++)) {
+ 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] ]] {
+ if [[ ${item[$j]} == ${self[$j]} ]] {
item[$j]=''
} else {
prefix+='../'
}
}
files[$i]=${prefix}
- for j in $item; {
- [[ -n $j ]] && files[$i]+="$j/"
+ for j in ${item}; {
+ [[ -n ${j} ]] && files[$i]+="${j}/"
}
files[$i]=${files[$i]%/}
}
}
-_wanted files expl 'index file' _multi_parts $@ - / files
+_wanted files expl 'index file' _multi_parts ${@} - / files