completion: do not cache if --git-completion-helper fails
[gitweb.git] / contrib / completion / git-completion.bash
index 499e56f83d0a0592abd53686612c79358780eef2..00cc695e3d748cc27b106ef96b6f579886277954 100644 (file)
@@ -400,7 +400,8 @@ __gitcomp_builtin ()
        if [ -z "$options" ]; then
                # leading and trailing spaces are significant to make
                # option removal work correctly.
-               options=" $incl $(__git ${cmd/_/ } --git-completion-helper) "
+               options=" $incl $(__git ${cmd/_/ } --git-completion-helper) " || return
+
                for i in $excl; do
                        options="${options/ $i / }"
                done