@matheusbsbs / matheus-bagliano / commits / a81c311f23
Fork 0

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>

Junio C Hamano committed Dec 14, 2006 at 00:40 UTC a81c311f23a5fadd6c1da38d46781644cd9db6e8
1 file changed +7
git-reset.sh
+7
@@ -1,8 +1,15 @@
1 #!/bin/sh
2
3 USAGE='[--mixed | --soft | --hard] [<commit-ish>]'
4 +SUBDIRECTORY_OK=Yes
5 . git-sh-setup
6
7 +TOP=$(git-rev-parse --show-cdup)
8 +if test ! -z "$TOP"
9 +then
10 + cd "$TOP"
11 +fi
12 +
13 update=
14 reset_type=--mixed
15 case "$1" in