Merge branch 'jc/maint-protect-sh-from-ifs' into maint-1.7.11
authorJunio C Hamano <gitster@pobox.com>
Mon, 10 Sep 2012 22:25:45 +0000 (15:25 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Sep 2012 22:25:45 +0000 (15:25 -0700)
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

git-sh-setup.sh
index 770a86e2b7a5e517e51d9897b274b876a6b9e0e1..ee0e0bc045bb7d92045a3afb0a042748834e6163 100644 (file)
@@ -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 ;;