Skip to content

Commit e4ffba4

Browse files
committed
Merge branch 'js/builtin-add-p-portability-fix'
More fixes to "add -p" * js/builtin-add-p-portability-fix: t6132(NO_PERL): do not run the scripted `add -p` t3701: test the built-in `add -i` regardless of NO_PERL add -p: avoid ambiguous signed/unsigned comparison
2 parents 76ffa81 + 64ec8ef commit e4ffba4

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

add-patch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ static int patch_update_file(struct add_p_state *s,
15601560
strbuf_remove(&s->answer, 0, 1);
15611561
strbuf_trim(&s->answer);
15621562
i = hunk_index - DISPLAY_HUNKS_LINES / 2;
1563-
if (i < file_diff->mode_change)
1563+
if (i < (int)file_diff->mode_change)
15641564
i = file_diff->mode_change;
15651565
while (s->answer.len == 0) {
15661566
i = display_hunks(s, file_diff, i);

t/t3701-add-interactive.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
77
. ./test-lib.sh
88
. "$TEST_DIRECTORY"/lib-terminal.sh
99

10-
if ! test_have_prereq PERL
10+
if test_have_prereq !ADD_I_USE_BUILTIN,!PERL
1111
then
12-
skip_all='skipping add -i tests, perl not available'
12+
skip_all='skipping add -i (scripted) tests, perl not available'
1313
test_done
1414
fi
1515

t/t6132-pathspec-exclude.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,11 @@ test_expect_success 'add with all negative' '
293293
test_cmp expect actual
294294
'
295295

296-
test_expect_success 'add -p with all negative' '
296+
test_lazy_prereq ADD_I_USE_BUILTIN_OR_PERL '
297+
test_have_prereq ADD_I_USE_BUILTIN || test_have_prereq PERL
298+
'
299+
300+
test_expect_success ADD_I_USE_BUILTIN_OR_PERL 'add -p with all negative' '
297301
H=$(git rev-parse HEAD) &&
298302
git reset --hard $H &&
299303
git clean -f &&

0 commit comments

Comments
 (0)