Blame SOURCES/0001-Add-test-for-ls-tree-with-broken-symlink-under-refs-.patch

3de368
From 45eb1ba86022558d71a9946ccbe173ba5d8f1e37 Mon Sep 17 00:00:00 2001
3de368
From: Petr Stodulka <pstodulk@redhat.com>
3de368
Date: Thu, 13 Oct 2016 13:23:47 +0200
3de368
Subject: [PATCH 1/2] Add test for ls-tree with broken symlink under refs/heads
3de368
3de368
git ls-tree goes into an infinite loop while serving pretty vanilla requests,
3de368
if the refs/heads/ directory contains a symlink that's broken. Added test
3de368
which check if git ends with expected exit code or timeout expires.
3de368
---
3de368
 t/t3103-ls-tree-misc.sh | 9 +++++++++
3de368
 1 file changed, 9 insertions(+)
3de368
3de368
diff --git a/t/t3103-ls-tree-misc.sh b/t/t3103-ls-tree-misc.sh
3de368
index 09dcf04..faf79c4 100755
3de368
--- a/t/t3103-ls-tree-misc.sh
3de368
+++ b/t/t3103-ls-tree-misc.sh
3de368
@@ -21,4 +21,13 @@ test_expect_success 'ls-tree fails with non-zero exit code on broken tree' '
3de368
 	test_must_fail git ls-tree -r HEAD
3de368
 '
3de368
 
3de368
+test_expect_success 'ls-tree fails due to broken symlink instead of infinite loop' '
3de368
+	mkdir foo_infinit &&
3de368
+	cd foo_infinit &&
3de368
+	git init testrepo &&
3de368
+	cd testrepo &&
3de368
+	mkdir -p .git/refs/remotes &&
3de368
+	ln -s ../remotes/foo .git/refs/heads/bar &&
3de368
+	test_expect_code 128 timeout 2 git ls-tree bar
3de368
+'
3de368
 test_done
3de368
-- 
3de368
2.5.5
3de368