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:
Junio C Hamano
2007-01-12 12:49:05 -08:00
parent 9fde9401a9
commit 514c09fdcf
4 changed files with 11 additions and 29 deletions

View File

@ -316,22 +316,16 @@ esac
################################################################
# Prepare index to have a tree to be committed
TOP=`git-rev-parse --show-cdup`
if test -z "$TOP"
then
TOP=./
fi
case "$all,$also" in
t,)
save_index &&
(
cd "$TOP"
GIT_INDEX_FILE="$NEXT_INDEX"
export GIT_INDEX_FILE
cd_to_toplevel &&
GIT_INDEX_FILE="$NEXT_INDEX" &&
export GIT_INDEX_FILE &&
git-diff-files --name-only -z |
git-update-index --remove -z --stdin
)
) || exit
;;
,t)
save_index &&
@ -339,11 +333,11 @@ t,)
git-diff-files --name-only -z -- "$@" |
(
cd "$TOP"
GIT_INDEX_FILE="$NEXT_INDEX"
export GIT_INDEX_FILE
cd_to_toplevel &&
GIT_INDEX_FILE="$NEXT_INDEX" &&
export GIT_INDEX_FILE &&
git-update-index --remove -z --stdin
)
) || exit
;;
,)
case "$#" in