Skip to content

Commit

Permalink
Revert "Merge branch 'rj/add-p-typo-reaction' into next"
Browse files Browse the repository at this point in the history
This reverts commit 8ac0509, reversing
changes made to bf66ab6.
  • Loading branch information
gitster committed Apr 26, 2024
1 parent 2a3ae87 commit 61ce827
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
5 changes: 1 addition & 4 deletions add-patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,7 @@ static int patch_update_file(struct add_p_state *s,
}
} else if (s->answer.buf[0] == 'p') {
rendered_hunk_index = -1;
} else if (s->answer.buf[0] == '?') {
} else {
const char *p = _(help_patch_remainder), *eol = p;

color_fprintf(stdout, s->s.help_color, "%s",
Expand All @@ -1692,9 +1692,6 @@ static int patch_update_file(struct add_p_state *s,
color_fprintf_ln(stdout, s->s.help_color,
"%.*s", (int)(eol - p), p);
}
} else {
err(s, _("Unknown command '%s' (use '?' for help)"),
s->answer.buf);
}
}

Expand Down
16 changes: 1 addition & 15 deletions t/t3701-add-interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-terminal.sh

SP=" "

diff_cmp () {
for x
do
Expand Down Expand Up @@ -58,19 +56,6 @@ test_expect_success 'warn about add.interactive.useBuiltin' '
done
'

test_expect_success 'unknown command' '
test_when_finished "git reset --hard; rm -f command" &&
echo W >command &&
git add -N command &&
git diff command >expect &&
cat >>expect <<-EOF &&
(1/1) Stage addition [y,n,q,a,d,e,p,?]? Unknown command ${SQ}W${SQ} (use ${SQ}?${SQ} for help)
(1/1) Stage addition [y,n,q,a,d,e,p,?]?$SP
EOF
git add -p -- command <command >actual 2>&1 &&
test_cmp expect actual
'

test_expect_success 'setup (initial)' '
echo content >file &&
git add file &&
Expand Down Expand Up @@ -247,6 +232,7 @@ test_expect_success 'setup file' '
'

test_expect_success 'setup patch' '
SP=" " &&
NULL="" &&
cat >patch <<-EOF
@@ -1,4 +1,4 @@
Expand Down

0 comments on commit 61ce827

Please sign in to comment.