From f2e1de027f9bf16e3db492ce6270d0395dfc5240 Mon Sep 17 00:00:00 2001 From: "the.friendly.net" <48805490+thefriendlynet@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:10:28 +0200 Subject: [PATCH] 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 --- netbox/core/data_backends.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/netbox/core/data_backends.py b/netbox/core/data_backends.py index 2d3a7d8c8..1b64f5f5c 100644 --- a/netbox/core/data_backends.py +++ b/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: