diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-04-26 06:39:03 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-04-26 06:39:03 (GMT) |
commit | 44427a0c18c0179be72223650715f031a10a5e66 (patch) | |
tree | 09eac9c685901b249bef83acaa93e21e18dd366a /t | |
parent | da4c6007301ec92f835c2a174efa3168a1626301 (diff) | |
parent | be4dbbbed931a1683e351b872865ed8d90e9ac2b (diff) | |
download | git-44427a0c18c0179be72223650715f031a10a5e66.zip git-44427a0c18c0179be72223650715f031a10a5e66.tar.gz git-44427a0c18c0179be72223650715f031a10a5e66.tar.bz2 |
Merge branch 'ps/pathspec-empty-prefix-origin'
A recent update broke "git add -p ../foo" from a subdirectory.
* ps/pathspec-empty-prefix-origin:
pathspec: honor `PATHSPEC_PREFIX_ORIGIN` with empty prefix
Diffstat (limited to 't')
-rwxr-xr-x | t/t3701-add-interactive.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh index f9528fa..2ecb43a 100755 --- a/t/t3701-add-interactive.sh +++ b/t/t3701-add-interactive.sh @@ -436,6 +436,28 @@ test_expect_success 'add -p handles globs' ' test_cmp expect actual ' +test_expect_success 'add -p handles relative paths' ' + git reset --hard && + + echo base >relpath.c && + git add "*.c" && + git commit -m relpath && + + echo change >relpath.c && + mkdir -p subdir && + git -C subdir add -p .. 2>error <<-\EOF && + y + EOF + + test_must_be_empty error && + + cat >expect <<-\EOF && + relpath.c + EOF + git diff --cached --name-only >actual && + test_cmp expect actual +' + test_expect_success 'add -p does not expand argument lists' ' git reset --hard && |