Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: tests/git_common_test.py

Issue 238213006: Abort git tools if git repo has too many local branches. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: change message Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « git_common.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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')
« no previous file with comments | « git_common.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698