Skip to content

Commit b18a213

Browse files
fix: fixed bug, where directories could not be pushed if commit files were selected
1 parent 53257a0 commit b18a213

File tree

1 file changed

+1
-1
lines changed
  • grader_labextension/services

1 file changed

+1
-1
lines changed

grader_labextension/services/git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ def copy_repo_contents(self, src: str, selected_files: List[str] = None):
254254
Args:
255255
src (str): path where the to be copied files reside
256256
"""
257+
ignore = shutil.ignore_patterns(".git", "__pycache__")
257258
if(selected_files):
258259
self.log.info(f"Copying only selected files from {src} to {self.path}")
259260
for item in os.listdir(src):
@@ -266,7 +267,6 @@ def copy_repo_contents(self, src: str, selected_files: List[str] = None):
266267
shutil.copy2(s, d)
267268
else:
268269
self.log.info(f"Copying repository contents from {src} to {self.path}")
269-
ignore = shutil.ignore_patterns(".git", "__pycache__")
270270
if sys.version_info.major == 3 and sys.version_info.minor >= 8:
271271
shutil.copytree(src, self.path, ignore=ignore, dirs_exist_ok=True)
272272
else:

0 commit comments

Comments
 (0)