Skip to content

Commit 4de15a8

Browse files
committed
Merge 'add-p-many-files'
This topic branch allows `add -p` and `add -i` with a large number of files. It is kind of a hack that was never really meant to be upstreamed. Let's see if we can do better in the built-in `add -p`. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 763d885 + 72487ea commit 4de15a8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

t/t3701-add-interactive.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,27 @@ test_expect_success 'checkout -p patch editing of added file' '
11671167
)
11681168
'
11691169

1170+
test_expect_success EXPENSIVE 'add -i with a lot of files' '
1171+
git reset --hard &&
1172+
x160=0123456789012345678901234567890123456789 &&
1173+
x160=$x160$x160$x160$x160 &&
1174+
y= &&
1175+
i=0 &&
1176+
while test $i -le 200
1177+
do
1178+
name=$(printf "%s%03d" $x160 $i) &&
1179+
echo $name >$name &&
1180+
git add -N $name &&
1181+
y="${y}y$LF" &&
1182+
i=$(($i+1)) ||
1183+
exit 1
1184+
done &&
1185+
echo "$y" | git add -p -- . &&
1186+
git diff --cached >staged &&
1187+
test_line_count = 1407 staged &&
1188+
git reset --hard
1189+
'
1190+
11701191
test_expect_success 'show help from add--helper' '
11711192
git reset --hard &&
11721193
cat >expect <<-EOF &&

0 commit comments

Comments
 (0)