summaryrefslogtreecommitdiff
path: root/git-sh-setup.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-09-12 19:47:07 -0700
committerJunio C Hamano <junkio@cox.net>2005-09-12 22:52:51 -0700
commit365527adbfa8a16dfc05ab71818602f55ada55ba (patch)
tree6e99ea0f8308e2a73ac6e7c81877513412ddc64f /git-sh-setup.sh
parent2aba319a52b3601cff3f32b60bc28023ee45575d (diff)
downloadgit-365527adbfa8a16dfc05ab71818602f55ada55ba.tar.gz
Fix CDPATH problem.
CDPATH has two problems: * It takes scripts to unexpected places (somebody had CDPATH=..:../..:$HOME and the "cd" in git-clone.sh:get_repo_base took him to $HOME/.git when he said "clone foo bar" to clone a repository in "foo" which had "foo/.git"). CDPATH mechanism does not implicitly give "." at the beginning of CDPATH, which is the most irritating part. * The extra echo when it does its thing confuses scripts further. Most of our scripts that use "cd" includes git-sh-setup so the problem is primarily fixed there. git-clone starts without a repository, and it needs its own fix. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-sh-setup.sh')
-rwxr-xr-xgit-sh-setup.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 06d8299ce0..d5bfa62dee 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -6,6 +6,12 @@
: ${GIT_DIR=.git}
: ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
+# Having this variable in your environment would break scripts because
+# you would cause "cd" to be be taken to unexpected places. If you
+# like CDPATH, define it for your interactive shell sessions without
+# exporting it.
+unset CDPATH
+
die() {
echo "$@" >&2
exit 1