summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-12-05 20:52:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-12-05 20:52:47 (GMT)
commit6b3cb32f4353266ce02100b49ad5bff3701aa0e8 (patch)
treeb172b24ec50e72a6de69bb422c70cbfb2bc05d6d /t
parent57d46bc602a6911946dc4ba7f4e79cd82cbc1e3e (diff)
parent0a8e3036a304d99de24432d65a3d3920dd6e2e46 (diff)
downloadgit-6b3cb32f4353266ce02100b49ad5bff3701aa0e8.zip
git-6b3cb32f4353266ce02100b49ad5bff3701aa0e8.tar.gz
git-6b3cb32f4353266ce02100b49ad5bff3701aa0e8.tar.bz2
Merge branch 'nl/reset-patch-takes-a-tree'
"git reset --patch $object" without any pathspec should allow a tree object to be given, but incorrectly required a committish, which has been corrected. * nl/reset-patch-takes-a-tree: reset: parse rev as tree-ish in patch mode
Diffstat (limited to 't')
-rwxr-xr-xt/t7105-reset-patch.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t7105-reset-patch.sh b/t/t7105-reset-patch.sh
index bd10a96..fc2a6cf 100755
--- a/t/t7105-reset-patch.sh
+++ b/t/t7105-reset-patch.sh
@@ -38,6 +38,27 @@ test_expect_success PERL 'git reset -p HEAD^' '
test_i18ngrep "Apply" output
'
+test_expect_success PERL 'git reset -p HEAD^^{tree}' '
+ test_write_lines n y | git reset -p HEAD^^{tree} >output &&
+ verify_state dir/foo work parent &&
+ verify_saved_state bar &&
+ test_i18ngrep "Apply" output
+'
+
+test_expect_success PERL 'git reset -p HEAD^:dir/foo (blob fails)' '
+ set_and_save_state dir/foo work work &&
+ test_must_fail git reset -p HEAD^:dir/foo &&
+ verify_saved_state dir/foo &&
+ verify_saved_state bar
+'
+
+test_expect_success PERL 'git reset -p aaaaaaaa (unknown fails)' '
+ set_and_save_state dir/foo work work &&
+ test_must_fail git reset -p aaaaaaaa &&
+ verify_saved_state dir/foo &&
+ verify_saved_state bar
+'
+
# The idea in the rest is that bar sorts first, so we always say 'y'
# first and if the path limiter fails it'll apply to bar instead of
# dir/foo. There's always an extra 'n' to reject edits to dir/foo in