completion: bash: trivial cleanup
There's no need to set a variable we are not going to use. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras committed
Oct 27, 2020 at 20:07 UTC
5a364d2a18311de1791375731678ca13cde89f13
1 file changed
+6
-7
contrib/completion/git-completion.bash
+6
-7
@@ -416,14 +416,13 @@ __gitcomp_builtin ()
416
local options
417
eval "options=\${$var-}"
418
419
- local completion_helper
420
- if [ "$GIT_COMPLETION_SHOW_ALL" = "1" ]; then
421
- completion_helper="--git-completion-helper-all"
422
- else
423
- completion_helper="--git-completion-helper"
424
- fi
425
-
419
if [ -z "$options" ]; then
420
+ local completion_helper
421
+ if [ "$GIT_COMPLETION_SHOW_ALL" = "1" ]; then
422
+ completion_helper="--git-completion-helper-all"
423
+ else
424
+ completion_helper="--git-completion-helper"
425
+ fi
426
# leading and trailing spaces are significant to make
427
# option removal work correctly.
428
options=" $incl $(__git ${cmd/_/ } $completion_helper) " || return