From: "Ville Skyttä" <ville.skytta@iki.fi>
To: git@vger.kernel.org
Subject: [PATCH] completion: treat unset GIT_COMPLETION_SHOW_ALL gracefully
Date: Tue, 6 Apr 2021 21:12:47 +0300 [thread overview]
Message-ID: <20210406181247.250046-1-ville.skytta@iki.fi> (raw)
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
next reply other threads:[~2021-04-06 18:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 18:12 Ville Skyttä [this message]
2021-04-06 22:16 ` [PATCH] completion: treat unset GIT_COMPLETION_SHOW_ALL gracefully Junio C Hamano
2021-04-08 6:52 ` Ville Skyttä
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210406181247.250046-1-ville.skytta@iki.fi \
--to=ville.skytta@iki.fi \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).