summaryrefslogtreecommitdiff
path: root/git-checkout.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-01-12 20:49:05 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-01-13 00:54:38 (GMT)
commit514c09fdcfef6385f1a61ee52344794356c99986 (patch)
tree54aae1aa9262a75465bfb093761e85308a5164b0 /git-checkout.sh
parent9fde9401a9c3974a407f302d60a1b75e8787f715 (diff)
downloadgit-514c09fdcfef6385f1a61ee52344794356c99986.zip
git-514c09fdcfef6385f1a61ee52344794356c99986.tar.gz
git-514c09fdcfef6385f1a61ee52344794356c99986.tar.bz2
Use cd_to_toplevel in scripts that implement it by hand.
This converts scripts that do "cd $(rev-parse --show-cdup)" by hand to use cd_to_toplevel. I think git-fetch does not have to go to the toplevel, but that should be dealt with in a separate patch. Signed-off-by: Junio C Hamano <junkio@cox.net>
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 a2b8e4f..66e40b9 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"