Skip to content

Commit 37716fd

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 114a9aa + 68c871f commit 37716fd

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
@@ -1119,6 +1119,27 @@ test_expect_success 'checkout -p patch editing of added file' '
11191119
)
11201120
'
11211121

1122+
test_expect_success EXPENSIVE 'add -i with a lot of files' '
1123+
git reset --hard &&
1124+
x160=0123456789012345678901234567890123456789 &&
1125+
x160=$x160$x160$x160$x160 &&
1126+
y= &&
1127+
i=0 &&
1128+
while test $i -le 200
1129+
do
1130+
name=$(printf "%s%03d" $x160 $i) &&
1131+
echo $name >$name &&
1132+
git add -N $name &&
1133+
y="${y}y$LF" &&
1134+
i=$(($i+1)) ||
1135+
exit 1
1136+
done &&
1137+
echo "$y" | git add -p -- . &&
1138+
git diff --cached >staged &&
1139+
test_line_count = 1407 staged &&
1140+
git reset --hard
1141+
'
1142+
11221143
test_expect_success 'show help from add--helper' '
11231144
git reset --hard &&
11241145
cat >expect <<-EOF &&

0 commit comments

Comments
 (0)