Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-08-08 23:08:17 +0400
committerJunio C Hamano <gitster@pobox.com>2012-08-09 01:36:33 +0400
commit785063e02bb249ef3a39db88575fe626b310d4a7 (patch)
treeb23673aef74184f0413ee71044df6034ec08aab6 /git-sh-setup.sh
parentd0f1ea6003d97e63110fa7d50bb07f546a909b6e (diff)
sh-setup: protect from exported IFS
Many scripted Porcelains rely on being able to split words at the default $IFS characters, i.e. SP, HT and LF. If the user exports a non-default IFS to the environment, what they read from plumbing commands such as ls-files that use HT to delimit fields may not be split in the way we expect. Protect outselves by resetting it, just like we do so against CDPATH exported to the environment. Noticed by Andrew Dranse <adranse@oanda.com>. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-sh-setup.sh')
-rw-r--r--git-sh-setup.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 5d8e4e6c89..69472e4125 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -9,8 +9,12 @@
# you would cause "cd" to be taken to unexpected places. If you
# like CDPATH, define it for your interactive shell sessions without
# exporting it.
+# But we protect ourselves from such a user mistake nevertheless.
unset CDPATH
+# Similarly for IFS
+unset IFS
+
git_broken_path_fix () {
case ":$PATH:" in
*:$1:*) : ok ;;