From a81c311f23a5fadd6c1da38d46781644cd9db6e8 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 14 Dec 2006 00:40:15 -0800 Subject: [PATCH] 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 --- git-reset.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/git-reset.sh b/git-reset.sh index c0feb4435..03d2c3b93 100755 --- a/git-reset.sh +++ b/git-reset.sh @@ -1,8 +1,15 @@ #!/bin/sh USAGE='[--mixed | --soft | --hard] []' +SUBDIRECTORY_OK=Yes . git-sh-setup +TOP=$(git-rev-parse --show-cdup) +if test ! -z "$TOP" +then + cd "$TOP" +fi + update= reset_type=--mixed case "$1" in -- 2.30.2