git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Abort early if not being sourced under bash.
@ 2008-02-08 21:10 Ville Skyttä
  2008-02-08 21:14 ` Johannes Schindelin
  2008-02-08 21:31 ` Junio C Hamano
  0 siblings, 2 replies; 3+ messages in thread
From: Ville Skyttä @ 2008-02-08 21:10 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git

Subject: [PATCH] Abort early if not being sourced under bash.

This way, the file can be safely sourced from profile files shared with
non-bash shells, eg. dropped into /etc/profile.d like directories.

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

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 4ea727b..3cde9f4 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -45,6 +45,8 @@
 #       git@vger.kernel.org
 #
 
+[ -z "$BASH_VERSION" ] && return
+
 __gitdir ()
 {
 	if [ -z "$1" ]; then
-- 
1.5.3.8

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

end of thread, other threads:[~2008-02-08 21:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-08 21:10 [PATCH] Abort early if not being sourced under bash Ville Skyttä
2008-02-08 21:14 ` Johannes Schindelin
2008-02-08 21:31 ` Junio C Hamano

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).