Skip to content

Commit 496b92d

Browse files
dschoGit for Windows Build Agent
authored andcommitted
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 a33a6e3 + dee7131 commit 496b92d

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
@@ -1204,6 +1204,27 @@ test_expect_success 'checkout -p patch editing of added file' '
12041204
)
12051205
'
12061206

1207+
test_expect_success EXPENSIVE 'add -i with a lot of files' '
1208+
git reset --hard &&
1209+
x160=0123456789012345678901234567890123456789 &&
1210+
x160=$x160$x160$x160$x160 &&
1211+
y= &&
1212+
i=0 &&
1213+
while test $i -le 200
1214+
do
1215+
name=$(printf "%s%03d" $x160 $i) &&
1216+
echo $name >$name &&
1217+
git add -N $name &&
1218+
y="${y}y$LF" &&
1219+
i=$(($i+1)) ||
1220+
exit 1
1221+
done &&
1222+
echo "$y" | git add -p -- . &&
1223+
git diff --cached >staged &&
1224+
test_line_count = 1407 staged &&
1225+
git reset --hard
1226+
'
1227+
12071228
test_expect_success 'show help from add--helper' '
12081229
git reset --hard &&
12091230
cat >expect <<-EOF &&

0 commit comments

Comments
 (0)