git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] completion: treat unset GIT_COMPLETION_SHOW_ALL gracefully
@ 2021-04-06 18:12 Ville Skyttä
  2021-04-06 22:16 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Ville Skyttä @ 2021-04-06 18:12 UTC (permalink / raw)
  To: git

If not set, referencing it in nounset (set -u) mode unguarded produces
an error.

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index e1a66954fe..6d77f56f92 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -427,7 +427,7 @@ __gitcomp_builtin ()
 
 	if [ -z "$options" ]; then
 		local completion_helper
-		if [ "$GIT_COMPLETION_SHOW_ALL" = "1" ]; then
+		if [ "${GIT_COMPLETION_SHOW_ALL-}" = "1" ]; then
 			completion_helper="--git-completion-helper-all"
 		else
 			completion_helper="--git-completion-helper"
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-08  6:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-06 18:12 [PATCH] completion: treat unset GIT_COMPLETION_SHOW_ALL gracefully Ville Skyttä
2021-04-06 22:16 ` Junio C Hamano
2021-04-08  6:52   ` Ville Skyttä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).