summaryrefslogtreecommitdiff
path: root/etc/completions/__git_files
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-12-22 12:24:17 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2008-12-22 12:24:17 +0100
commita008a5e057445c05709f827d7ee01ddccad24026 (patch)
treeebdca5171f48a7ce7fc8cc730ea383c83a809cbc /etc/completions/__git_files
parentde99d797adc385f2870303431313bf236fed1b1f (diff)
__git_files: Return if gitdir is empty (->no git repo)
Diffstat (limited to 'etc/completions/__git_files')
-rw-r--r--etc/completions/__git_files2
1 files changed, 2 insertions, 0 deletions
diff --git a/etc/completions/__git_files b/etc/completions/__git_files
index 6b8c1dd..ef14c31 100644
--- a/etc/completions/__git_files
+++ b/etc/completions/__git_files
@@ -12,6 +12,8 @@ ls_opts=("--exclude-per-directory=.gitignore")
files=(${(ps:\0:)"$(cd $gitdir/..; _call_program files git ls-files -z $ls_opts $opts 2>/dev/null)"})
__git_command_successful || return
+[[ -n $gitdir ]] || return
+
if [[ ! -d .git ]] {
dirdiff=${PWD#${gitdir%/.git}}
repeat ${#${(s:/:)dirdiff}}; do