fixes git repo issue
This commit is contained in:
parent
51d06cff92
commit
112dd68f16
|
@ -3,5 +3,5 @@
|
|||
|
||||
"""Main module for the rsl_rl package."""
|
||||
|
||||
__version__ = "2.0.0"
|
||||
__version__ = "2.0.1"
|
||||
__license__ = "BSD-3"
|
||||
|
|
|
@ -60,7 +60,11 @@ def unpad_trajectories(trajectories, masks):
|
|||
|
||||
def store_code_state(logdir, repositories):
|
||||
for repository_file_path in repositories:
|
||||
repo = git.Repo(repository_file_path, search_parent_directories=True)
|
||||
try:
|
||||
repo = git.Repo(repository_file_path, search_parent_directories=True)
|
||||
except git.InvalidGitRepositoryError:
|
||||
# skip if not a git repository
|
||||
continue
|
||||
repo_name = pathlib.Path(repo.working_dir).name
|
||||
t = repo.head.commit.tree
|
||||
content = f"--- git status ---\n{repo.git.status()} \n\n\n--- git diff ---\n{repo.git.diff(t)}"
|
||||
|
|
Loading…
Reference in New Issue