summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-08-29 14:49:45 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-08-29 14:49:45 -0700
commit72c4dbec2c782fd1f25694352c611374b3e56fe8 (patch)
treec0ce31e97ae40b3f1127bec50133df5dfdd10b93
parentMerge branch 'bc/prune-info' (diff)
parentsh-setup: protect from exported IFS (diff)
downloadtgif-72c4dbec2c782fd1f25694352c611374b3e56fe8.tar.xz
Merge branch 'jc/maint-protect-sh-from-ifs'
When the user exports a non-default IFS without HT, scripts that rely on being able to parse "ls-files -s | while read a b c..." start to fail. Protect them from such a misconfiguration. * jc/maint-protect-sh-from-ifs: sh-setup: protect from exported IFS
-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 770a86e2b7..ee0e0bc045 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 ;;