Merge pull request #218 from Ondkloss/fix/win32logger

Suggested modification to fix win32 logging failure
This commit is contained in:
Jose Diaz-Gonzalez
2023-10-09 20:38:38 -04:00
committed by GitHub

View File

@@ -42,7 +42,6 @@ logger = logging.getLogger(__name__)
def logging_subprocess( def logging_subprocess(
popenargs, popenargs,
logger,
stdout_log_level=logging.DEBUG, stdout_log_level=logging.DEBUG,
stderr_log_level=logging.ERROR, stderr_log_level=logging.ERROR,
**kwargs **kwargs
@@ -1285,12 +1284,12 @@ def fetch_repository(
if "origin" not in remotes: if "origin" not in remotes:
git_command = ["git", "remote", "rm", "origin"] git_command = ["git", "remote", "rm", "origin"]
logging_subprocess(git_command, None, cwd=local_dir) logging_subprocess(git_command, cwd=local_dir)
git_command = ["git", "remote", "add", "origin", remote_url] git_command = ["git", "remote", "add", "origin", remote_url]
logging_subprocess(git_command, None, cwd=local_dir) logging_subprocess(git_command, cwd=local_dir)
else: else:
git_command = ["git", "remote", "set-url", "origin", remote_url] git_command = ["git", "remote", "set-url", "origin", remote_url]
logging_subprocess(git_command, None, cwd=local_dir) logging_subprocess(git_command, cwd=local_dir)
if lfs_clone: if lfs_clone:
git_command = ["git", "lfs", "fetch", "--all", "--prune"] git_command = ["git", "lfs", "fetch", "--all", "--prune"]
@@ -1298,7 +1297,7 @@ def fetch_repository(
git_command = ["git", "fetch", "--all", "--force", "--tags", "--prune"] git_command = ["git", "fetch", "--all", "--force", "--tags", "--prune"]
if no_prune: if no_prune:
git_command.pop() git_command.pop()
logging_subprocess(git_command, None, cwd=local_dir) logging_subprocess(git_command, cwd=local_dir)
else: else:
logger.info( logger.info(
"Cloning {0} repository from {1} to {2}".format( "Cloning {0} repository from {1} to {2}".format(
@@ -1307,18 +1306,18 @@ def fetch_repository(
) )
if bare_clone: if bare_clone:
git_command = ["git", "clone", "--mirror", remote_url, local_dir] git_command = ["git", "clone", "--mirror", remote_url, local_dir]
logging_subprocess(git_command, None) logging_subprocess(git_command)
if lfs_clone: if lfs_clone:
git_command = ["git", "lfs", "fetch", "--all", "--prune"] git_command = ["git", "lfs", "fetch", "--all", "--prune"]
if no_prune: if no_prune:
git_command.pop() git_command.pop()
logging_subprocess(git_command, None, cwd=local_dir) logging_subprocess(git_command, cwd=local_dir)
else: else:
if lfs_clone: if lfs_clone:
git_command = ["git", "lfs", "clone", remote_url, local_dir] git_command = ["git", "lfs", "clone", remote_url, local_dir]
else: else:
git_command = ["git", "clone", remote_url, local_dir] git_command = ["git", "clone", remote_url, local_dir]
logging_subprocess(git_command, None) logging_subprocess(git_command)
def backup_account(args, output_directory): def backup_account(args, output_directory):