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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Shawn O. Pearce <spearce@...>
Cc: <git@...>
Date: Friday, February 8, 2008 - 5:10 pm

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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Abort early if not being sourced under bash., Ville , (Fri Feb 8, 5:10 pm)
Re: [PATCH] Abort early if not being sourced under bash., Junio C Hamano, (Fri Feb 8, 5:31 pm)
Re: [PATCH] Abort early if not being sourced under bash., Johannes Schindelin, (Fri Feb 8, 5:14 pm)