git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/3] update-ref: test handling large transactions properly

From
Stefan Beller <sbeller@google.com>
Date
Apr 14, 2015, 22:25 UTC
Message-ID
<1429050308-9617-2-git-send-email-sbeller@google.com>
In-Reply-To
<1429050308-9617-1-git-send-email-sbeller@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t1400-update-ref.sh | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 7b4707b..47d2fe9 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -973,4 +973,32 @@ test_expect_success 'stdin -z delete refs works with packed and loose refs' '
 	test_must_fail git rev-parse --verify -q $c
 '
 
+run_with_limited_open_files () {
+	(ulimit -n 32 && "$@")
+}
+
+test_lazy_prereq ULIMIT_FILE_DESCRIPTORS 'run_with_limited_open_files true'
+
+test_expect_failure ULIMIT_FILE_DESCRIPTORS 'large transaction creating branches does not burst open file limit' '
+(
+	for i in $(test_seq 33)
+	do
+		echo "create refs/heads/$i HEAD"
+	done >large_input &&
+	run_with_limited_open_files git update-ref --stdin <large_input &&
+	git rev-parse --verify -q refs/heads/33
+)
+'
+
+test_expect_failure ULIMIT_FILE_DESCRIPTORS 'large transaction deleting branches does not burst open file limit' '
+(
+	for i in $(test_seq 33)
+	do
+		echo "delete refs/heads/$i HEAD"
+	done >large_input &&
+	run_with_limited_open_files git update-ref --stdin <large_input &&
+	test_must_fail git rev-parse --verify -q refs/heads/33
+)
+'
+
 test_done
-- 
2.3.0.81.gc37f363
Previous: Stefan BellerNext: Stefan Beller
Message 2 of 7 in “Large transactions in git”
  1. 0/3 Large transactions in gitStefan Beller, Apr 14, 2015
  2. 1/3 update-ref: test handling large transactions properlyStefan Beller, Apr 14, 2015
  3. 2/3 t7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZEStefan Beller, Apr 14, 2015
  4. 3/3 refs.c: remove lock_fd from struct ref_lockStefan Beller, Apr 14, 2015
  5. Junio C HamanoApr 14, 2015
  6. Michael HaggertyApr 15, 2015
  7. Junio C HamanoApr 15, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.