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>
This commit is contained in:
@ -5,12 +5,8 @@ USAGE='<fetch-options> <repository> <refspec>...'
|
||||
SUBDIRECTORY_OK=Yes
|
||||
. git-sh-setup
|
||||
set_reflog_action "fetch $*"
|
||||
cd_to_toplevel ;# probably unnecessary...
|
||||
|
||||
TOP=$(git-rev-parse --show-cdup)
|
||||
if test ! -z "$TOP"
|
||||
then
|
||||
cd "$TOP"
|
||||
fi
|
||||
. git-parse-remote
|
||||
_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
|
||||
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
|
||||
|
||||
Reference in New Issue
Block a user