Skip to content

Commit

Permalink
Merge branch 'jc/maint-protect-sh-from-ifs'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Aug 29, 2012
2 parents b49203b + 785063e commit 72c4dbe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions git-sh-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;;
Expand Down

0 comments on commit 72c4dbe

Please sign in to comment.