Skip to content

Commit 890eae2

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 48a7887 + 9753fea commit 890eae2

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
@@ -1085,6 +1085,27 @@ test_expect_success 'checkout -p patch editing of added file' '
10851085
)
10861086
'
10871087

1088+
test_expect_success EXPENSIVE 'add -i with a lot of files' '
1089+
git reset --hard &&
1090+
x160=0123456789012345678901234567890123456789 &&
1091+
x160=$x160$x160$x160$x160 &&
1092+
y= &&
1093+
i=0 &&
1094+
while test $i -le 200
1095+
do
1096+
name=$(printf "%s%03d" $x160 $i) &&
1097+
echo $name >$name &&
1098+
git add -N $name &&
1099+
y="${y}y$LF" &&
1100+
i=$(($i+1)) ||
1101+
exit 1
1102+
done &&
1103+
echo "$y" | git add -p -- . &&
1104+
git diff --cached >staged &&
1105+
test_line_count = 1407 staged &&
1106+
git reset --hard
1107+
'
1108+
10881109
test_expect_success 'show help from add--helper' '
10891110
git reset --hard &&
10901111
cat >expect <<-EOF &&

0 commit comments

Comments
 (0)