]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
ci: helper: Add Python code hangling git clones
authorErik Skultety <eskultet@redhat.com>
Thu, 24 Aug 2023 08:24:12 +0000 (10:24 +0200)
committerErik Skultety <eskultet@redhat.com>
Tue, 12 Sep 2023 09:36:03 +0000 (11:36 +0200)
This helper will be utilized by a future patch which will add the
lcitool container execution logic. The reason why the required_deps
decorator isn't being used here is because this is a property.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
ci/helper

index 4727145b2894db6f77f1db16b077d5336e21937a..6aca089db43a5930e897f720da639cbdbc494f9c 100755 (executable)
--- a/ci/helper
+++ b/ci/helper
@@ -159,9 +159,18 @@ class Parser:
 
 
 class Application:
+    @property
+    def repo(self):
+        if self._repo is None:
+            from git import Repo
+
+            self._repo = Repo(search_parent_directories=True)
+        return self._repo
+
     def __init__(self):
         self._basedir = pathlib.Path(__file__).resolve().parent
         self._args = Parser().parse()
+        self._repo = None
 
     def _make_run(self, target):
         args = [