Skip to content

Commit

Permalink
git-reset: make it work from within a subdirectory.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Dec 14, 2006
1 parent 4da9028 commit a81c311
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions git-reset.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/bin/sh

USAGE='[--mixed | --soft | --hard] [<commit-ish>]'
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
Expand Down

0 comments on commit a81c311

Please sign in to comment.