Skip to content

Commit 3aaae53

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 01d2c97 + a05e3c1 commit 3aaae53

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

t/t3701-add-interactive.sh

+21
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,27 @@ test_expect_success 'checkout -p patch editing of added file' '
11661166
)
11671167
'
11681168

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

0 commit comments

Comments
 (0)