Index: tests/git_common_test.py |
diff --git a/tests/git_common_test.py b/tests/git_common_test.py |
index 39d2ecbc289ea35540fe0444515f8b632a172260..56955592eb138d3173f454c79c5e047c95650655 100755 |
--- a/tests/git_common_test.py |
+++ b/tests/git_common_test.py |
@@ -392,6 +392,23 @@ class GitMutableStructuredTest(git_test_utils.GitRepoReadWriteTestBase, |
self.repo.git('branch', '--set-upstream-to', 'root_A', 'branch_G') |
self.repo.git('branch', '--set-upstream-to', 'root_X', 'root_A') |
+ def testTooManyBranches(self): |
+ for i in xrange(30): |
+ self.repo.git('branch', 'a'*i) |
+ |
+ with self.assertRaises(SystemExit): |
+ self.repo.run(list, self.gc.branches()) |
+ |
+ self.repo.git('config', 'depot-tools.branch-limit', 'cat') |
+ |
+ with self.assertRaises(SystemExit): |
+ self.repo.run(list, self.gc.branches()) |
+ |
+ self.repo.git('config', 'depot-tools.branch-limit', '100') |
+ |
+ # should not raise |
+ self.assertEqual(36, len(self.repo.run(list, self.gc.branches()))) |
+ |
def testMergeBase(self): |
self.repo.git('checkout', 'branch_K') |