diff options
author | Rubén Justo <rjusto@gmail.com> | 2024-07-25 15:44:16 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-07-25 18:03:00 +0200 |
commit | 7309be1fc52bc155b711a741e30a6e55ae9c3cdf (patch) | |
tree | 9c70cbc421bba23d3de033bd161e434ee0f1e918 /t/t3701-add-interactive.sh | |
parent | Git 2.46-rc0 (diff) | |
download | git-7309be1fc52bc155b711a741e30a6e55ae9c3cdf.tar.xz git-7309be1fc52bc155b711a741e30a6e55ae9c3cdf.zip |
add-patch: test for 'p' command
Add a test for the 'p' command, which was introduced in 66c14ab592
(add-patch: introduce 'p' in interactive-patch, 2024-03-29).
Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rwxr-xr-x | t/t3701-add-interactive.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh index 5d78868ac1..6daf3a6be0 100755 --- a/t/t3701-add-interactive.sh +++ b/t/t3701-add-interactive.sh @@ -575,6 +575,22 @@ test_expect_success 'navigate to hunk via regex / pattern' ' test_cmp expect actual.trimmed ' +test_expect_success 'print again the hunk' ' + test_when_finished "git reset" && + tr _ " " >expect <<-EOF && + +15 + 20 + (1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,p,?]? @@ -1,2 +1,3 @@ + 10 + +15 + 20 + (1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,p,?]?_ + EOF + test_write_lines s y g 1 p | git add -p >actual && + tail -n 7 <actual >actual.trimmed && + test_cmp expect actual.trimmed +' + test_expect_success 'split hunk "add -p (edit)"' ' # Split, say Edit and do nothing. Then: # |