Forráskód Böngészése

Fixes #16760: datasource git on local file system fails (#16872)

* Fixes #16760: datasource git on local file system fails

* Fixes #16760: datasource git on local file system fails

* Set depth & quiet parameters only if using a remote URL

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
the.friendly.net 1 éve
szülő
commit
0e0d6172a4
1 módosított fájl, 3 hozzáadás és 2 törlés
  1. 3 2
      netbox/core/data_backends.py

+ 3 - 2
netbox/core/data_backends.py

@@ -84,9 +84,7 @@ class GitBackend(DataBackend):
         clone_args = {
             "branch": self.params.get('branch'),
             "config": self.config,
-            "depth": 1,
             "errstream": porcelain.NoneStream(),
-            "quiet": True,
         }
 
         if self.url_scheme in ('http', 'https'):
@@ -97,6 +95,9 @@ class GitBackend(DataBackend):
                         "password": self.params.get('password'),
                     }
                 )
+        if self.url_scheme:
+            clone_args["quiet"] = True
+            clone_args["depth"] = 1
 
         logger.debug(f"Cloning git repo: {self.url}")
         try: