Merge branch 'jk/trailing-slash-in-pathspec'

Code refactoring.

* jk/trailing-slash-in-pathspec:
  reset: handle submodule with trailing slash
  rm: re-use parse_pathspec's trailing-slash removal
This commit is contained in:
Junio C Hamano
2013-10-17 15:55:13 -07:00
3 changed files with 14 additions and 20 deletions

View File

@ -481,7 +481,7 @@ test_expect_success 'do not add files from a submodule' '
'
test_expect_success 'gracefully add submodule with a trailing slash' '
test_expect_success 'gracefully add/reset submodule with a trailing slash' '
git reset --hard &&
git commit -m "commit subproject" init &&
@ -495,7 +495,9 @@ test_expect_success 'gracefully add submodule with a trailing slash' '
git add init/ &&
test_must_fail git diff --exit-code --cached init &&
test $commit = $(git ls-files --stage |
sed -n "s/^160000 \([^ ]*\).*/\1/p")
sed -n "s/^160000 \([^ ]*\).*/\1/p") &&
git reset init/ &&
git diff --exit-code --cached init
'