Skip to content

Commit d415ad0

Browse files
stefanbellergitster
authored andcommitted
update-ref: test handling large transactions properly
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3d4a3ff commit d415ad0

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

t/t1400-update-ref.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,4 +1065,32 @@ test_expect_success 'stdin -z delete refs works with packed and loose refs' '
10651065
test_must_fail git rev-parse --verify -q $c
10661066
'
10671067

1068+
run_with_limited_open_files () {
1069+
(ulimit -n 32 && "$@")
1070+
}
1071+
1072+
test_lazy_prereq ULIMIT_FILE_DESCRIPTORS 'run_with_limited_open_files true'
1073+
1074+
test_expect_failure ULIMIT_FILE_DESCRIPTORS 'large transaction creating branches does not burst open file limit' '
1075+
(
1076+
for i in $(test_seq 33)
1077+
do
1078+
echo "create refs/heads/$i HEAD"
1079+
done >large_input &&
1080+
run_with_limited_open_files git update-ref --stdin <large_input &&
1081+
git rev-parse --verify -q refs/heads/33
1082+
)
1083+
'
1084+
1085+
test_expect_failure ULIMIT_FILE_DESCRIPTORS 'large transaction deleting branches does not burst open file limit' '
1086+
(
1087+
for i in $(test_seq 33)
1088+
do
1089+
echo "delete refs/heads/$i HEAD"
1090+
done >large_input &&
1091+
run_with_limited_open_files git update-ref --stdin <large_input &&
1092+
test_must_fail git rev-parse --verify -q refs/heads/33
1093+
)
1094+
'
1095+
10681096
test_done

0 commit comments

Comments
 (0)