reset: handle submodule with trailing slash
commit2c63d6eb46da4ef0abc9c040c927818e437d2fcc
authorJohn Keeping <john@keeping.me.uk>
Thu, 12 Sep 2013 19:25:01 +0000 (12 20:25 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Sep 2013 19:37:35 +0000 (13 12:37 -0700)
tree101554c37a1be825ce61f13b77a956434ac90788
parentf8bc2ac3bf2df76ae864041a5496fab6446ad189
reset: handle submodule with trailing slash

When using tab-completion, a directory path will often end with a
trailing slash which currently confuses "git reset" when dealing with
submodules.  Now that we have parse_pathspec we can easily handle this
by simply adding the PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP flag.

To do this, we need to move the read_cache() call before the
parse_pathspec() call.  All of the existing paths through cmd_reset()
that do not die early already call read_cache() at some point, so there
is no performance impact to doing this in the common case.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/reset.c
t/t7400-submodule-basic.sh