Skip to content

Commit

Permalink
Check results
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Schesch committed May 8, 2024
1 parent dd2f0fb commit 05d9f85
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
24 changes: 17 additions & 7 deletions src/python/replay_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,23 @@ def merge_replay(
merge_fingerprint,
]
assert repo.local_repo_path.exists()
if merge_result not in (
MERGE_STATE.Merge_failed,
MERGE_STATE.Git_checkout_failed,
TEST_STATE.Git_checkout_failed,
) and (
merge_data[f"{merge_tool.name}_merge_fingerprint"] != merge_fingerprint
and not dont_check_fingerprints

if ( # pylint: disable=too-many-boolean-expressions
merge_result
not in (
MERGE_STATE.Git_checkout_failed,
TEST_STATE.Git_checkout_failed,
)
and (
merge_data[f"{merge_tool.name}_merge_fingerprint"]
!= merge_fingerprint
and not dont_check_fingerprints
)
and (merge_tool != MERGE_TOOL.spork)
and (
merge_tool != MERGE_TOOL.gitmerge_resolve
or merge_result != MERGE_STATE.Merge_failed
)
):
assert repo.local_repo_path.exists()
if create_artifacts:
Expand Down
13 changes: 0 additions & 13 deletions src/python/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,20 +242,7 @@ def copy_repo(self) -> None:
ignore_dangling_symlinks=True,
)
os.system("chmod -R 777 " + str(self.local_repo_path))
# Check if chmod worked
# Retrieve the mode (permissions) of the file/directory
mode = os.stat(str(self.local_repo_path)).st_mode

# Mask out the permission bits with 0o777 (octal for 777)
if mode & 0o777 == 0o777:
logger.error(
f"The permissions for {str(self.local_repo_path)} are set to 777."
)
else:
logger.error(
f"The permissions for {str(self.local_repo_path)} are not set to 777."
+ f" Current permissions: {oct(mode & 0o777)}"
)
self.repo = Repo(self.local_repo_path)

def checkout(self, commit: str, use_cache: bool = True) -> Tuple[bool, str]:
Expand Down

0 comments on commit 05d9f85

Please sign in to comment.