A few commands that recently learned the "--recurse-submodule"
option misbehaved when started from a subdirectory of the
superproject.
* bw/recurse-submodules-relative-fix:
ls-files: fix bug when recursing with relative pathspec
ls-files: fix typo in variable name
grep: fix bug when recursing with relative pathspec
setup: allow for prefix to be passed to git commands
grep: fix help text typo
@ -227,6 +227,81 @@ test_expect_success 'grep history with moved submoules' '
@@ -227,6 +227,81 @@ test_expect_success 'grep history with moved submoules' '
test_cmp expect actual
'
test_expect_success 'grep using relative path' '
test_when_finished "rm -rf parent sub" &&
git init sub &&
echo "foobar" >sub/file &&
git -C sub add file &&
git -C sub commit -m "add file" &&
git init parent &&
echo "foobar" >parent/file &&
git -C parent add file &&
mkdir parent/src &&
echo "foobar" >parent/src/file2 &&
git -C parent add src/file2 &&
git -C parent submodule add ../sub &&
git -C parent commit -m "add files and submodule" &&