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>
This commit is contained in:
the.friendly.net 2024-07-10 15:10:28 +02:00 committed by GitHub
parent bf97138c78
commit f2e1de027f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: