mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 23:10:42 +01:00
git: don't list all commits to check for an empty repo (#5075)
Saves us around 2sec (from ~7.5 to ~5.5) when parsing gitlab repo.
This commit is contained in:
@@ -285,7 +285,7 @@ class Git(Base):
|
||||
|
||||
@property
|
||||
def no_commits(self):
|
||||
return not self.list_all_commits()
|
||||
return not bool(self.get_ref("HEAD"))
|
||||
|
||||
def _backend_func(self, name, *args, **kwargs):
|
||||
for backend in self.backends.values():
|
||||
|
||||
Reference in New Issue
Block a user