1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-07 12:46:12 +02:00

Revert "Merge branch 'rj/add-p-typo-reaction' into next"

This reverts commit 8ac0509b47, reversing
changes made to bf66ab6ea7.
This commit is contained in:
Junio C Hamano 2024-04-26 09:05:19 -07:00
parent 2a3ae87e7f
commit 61ce8277cc
2 changed files with 2 additions and 19 deletions

View File

@ -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",
@ -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);
}
}

View File

@ -8,8 +8,6 @@ TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
SP=" "
diff_cmp () {
for x
do
@ -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 &&
@ -247,6 +232,7 @@ test_expect_success 'setup file' '
'
test_expect_success 'setup patch' '
SP=" " &&
NULL="" &&
cat >patch <<-EOF
@@ -1,4 +1,4 @@