git-reset: make it work from within a subdirectory.

If you typically sit in, say "src/", it's annoying to have to
change directory to do a reset.

This may need to be reworked when we add "git reset -- paths..."
to encapsulate the "ls-tree $tree | update-index --index-info"
pattern.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2006-12-14 00:40:15 -08:00
Родитель 4da9028578
Коммит a81c311f23
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -1,8 +1,15 @@
#!/bin/sh #!/bin/sh
USAGE='[--mixed | --soft | --hard] [<commit-ish>]' USAGE='[--mixed | --soft | --hard] [<commit-ish>]'
SUBDIRECTORY_OK=Yes
. git-sh-setup . git-sh-setup
TOP=$(git-rev-parse --show-cdup)
if test ! -z "$TOP"
then
cd "$TOP"
fi
update= update=
reset_type=--mixed reset_type=--mixed
case "$1" in case "$1" in