##// END OF EJS Templates
git: use smarter way for checking if repo is empty. This doesn't spam logs with some dulwich exceptions, we shouldn't really care about here.`
marcink -
r2955:7eb44380 default
parent child Browse files
Show More
@@ -177,9 +177,9 b' class GitRepository(BaseRepository):'
177 177 # we must check if this repo is not empty, since later command
178 178 # fails if it is. And it's cheaper to ask than throw the subprocess
179 179 # errors
180 try:
181 self._remote.head()
182 except KeyError:
180
181 head = self._remote.head(show_exc=False)
182 if not head:
183 183 return []
184 184
185 185 rev_filter = ['--branches', '--tags']
@@ -2206,7 +2206,9 b' class Repository(Base, BaseModel):'
2206 2206 if cs_cache is None:
2207 2207 # use no-cache version here
2208 2208 scm_repo = self.scm_instance(cache=False, config=config)
2209 if scm_repo:
2209
2210 empty = scm_repo.is_empty()
2211 if not empty:
2210 2212 cs_cache = scm_repo.get_commit(
2211 2213 pre_load=["author", "date", "message", "parents"])
2212 2214 else:
General Comments 0
You need to be logged in to leave comments. Login now