From b18a21369f86888f71e9c2920faceedf362626c5 Mon Sep 17 00:00:00 2001 From: "florian.jaeger" Date: Wed, 25 Sep 2024 09:36:41 +0200 Subject: [PATCH] fix: fixed bug, where directories could not be pushed if commit files were selected --- grader_labextension/services/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grader_labextension/services/git.py b/grader_labextension/services/git.py index 6297b9a..83e5dec 100644 --- a/grader_labextension/services/git.py +++ b/grader_labextension/services/git.py @@ -254,6 +254,7 @@ def copy_repo_contents(self, src: str, selected_files: List[str] = None): Args: src (str): path where the to be copied files reside """ + ignore = shutil.ignore_patterns(".git", "__pycache__") if(selected_files): self.log.info(f"Copying only selected files from {src} to {self.path}") for item in os.listdir(src): @@ -266,7 +267,6 @@ def copy_repo_contents(self, src: str, selected_files: List[str] = None): shutil.copy2(s, d) else: self.log.info(f"Copying repository contents from {src} to {self.path}") - ignore = shutil.ignore_patterns(".git", "__pycache__") if sys.version_info.major == 3 and sys.version_info.minor >= 8: shutil.copytree(src, self.path, ignore=ignore, dirs_exist_ok=True) else: