summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGavin Mak <gavinmak@google.com>2026-01-07 20:27:41 +0000
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2026-01-08 11:33:40 -0800
commite71a8c6dd85026c8861e675ed7ff468fc611df44 (patch)
tree0bc1ce1dddc3bd2777433aed3db28bcd9d7035e8 /tests
parentc687b5df9e049f928c295e771fdebf593cffaed7 (diff)
downloadgit-repo-e71a8c6dd85026c8861e675ed7ff468fc611df44.tar.gz
project: disable auto-gc for depth=1 in git configv2.61
During sync, `git checkout` can trigger fetch for missing objects in partial clones. This internal fetch can trigger `git maintenance` or `git gc` and cause delays during the local checkout phase. Set maintenance.auto to false and gc.auto to 0 in during `_InitRemote` if `depth=1` to ensure that implicit fetches spawned by git skip GC. Bug: 379111283 Change-Id: I6b22a4867f29b6e9598746cb752820a84dc2aeb6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/540681 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_git_config.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_git_config.py b/tests/test_git_config.py
index cf6e77939..e1604bd76 100644
--- a/tests/test_git_config.py
+++ b/tests/test_git_config.py
@@ -166,6 +166,30 @@ class GitConfigReadWriteTests(unittest.TestCase):
166 config = self.get_config() 166 config = self.get_config()
167 self.assertIsNone(config.GetBoolean("foo.bar")) 167 self.assertIsNone(config.GetBoolean("foo.bar"))
168 168
169 def test_SetInt(self):
170 """Test SetInt behavior."""
171 # Set a value.
172 self.assertIsNone(self.config.GetInt("foo.bar"))
173 self.config.SetInt("foo.bar", 10)
174 self.assertEqual(10, self.config.GetInt("foo.bar"))
175
176 # Make sure the value was actually written out.
177 config = self.get_config()
178 self.assertEqual(10, config.GetInt("foo.bar"))
179 self.assertEqual("10", config.GetString("foo.bar"))
180
181 # Update the value.
182 self.config.SetInt("foo.bar", 20)
183 self.assertEqual(20, self.config.GetInt("foo.bar"))
184 config = self.get_config()
185 self.assertEqual(20, config.GetInt("foo.bar"))
186
187 # Delete the value.
188 self.config.SetInt("foo.bar", None)
189 self.assertIsNone(self.config.GetInt("foo.bar"))
190 config = self.get_config()
191 self.assertIsNone(config.GetInt("foo.bar"))
192
169 def test_GetSyncAnalysisStateData(self): 193 def test_GetSyncAnalysisStateData(self):
170 """Test config entries with a sync state analysis data.""" 194 """Test config entries with a sync state analysis data."""
171 superproject_logging_data = {} 195 superproject_logging_data = {}