diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-12-22 12:24:17 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-12-22 12:24:17 +0100 |
commit | a008a5e057445c05709f827d7ee01ddccad24026 (patch) | |
tree | ebdca5171f48a7ce7fc8cc730ea383c83a809cbc | |
parent | de99d797adc385f2870303431313bf236fed1b1f (diff) |
__git_files: Return if gitdir is empty (->no git repo)
-rw-r--r-- | etc/completions/__git_files | 2 |
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 |