summaryrefslogtreecommitdiff
path: root/git-checkout.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2007-01-14 11:41:36 -0800
committerLibravatar Junio C Hamano <junkio@cox.net>2007-01-14 11:41:36 -0800
commit3681d40b965258f7559235642c75f2117476765e (patch)
tree61247899bdc5cd8a5109a568251e6ab3ffd1cf44 /git-checkout.sh
parentRemove read_or_die in favor of better error messages. (diff)
parentAllow whole-tree operations to be started from a subdirectory (diff)
downloadtgif-3681d40b965258f7559235642c75f2117476765e.tar.xz
Merge branch 'jc/subdir'
* jc/subdir: Allow whole-tree operations to be started from a subdirectory Use cd_to_toplevel in scripts that implement it by hand. Define cd_to_toplevel shell function in git-sh-setup
Diffstat (limited to 'git-checkout.sh')
-rwxr-xr-xgit-checkout.sh6
1 files changed, 1 insertions, 5 deletions
diff --git a/git-checkout.sh b/git-checkout.sh
index a2b8e4fa4a..66e40b90eb 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -135,11 +135,7 @@ fi
# We are switching branches and checking out trees, so
# we *NEED* to be at the toplevel.
-cdup=$(git-rev-parse --show-cdup)
-if test ! -z "$cdup"
-then
- cd "$cdup"
-fi
+cd_to_toplevel
[ -z "$new" ] && new=$old && new_name="$old_name"