Skip to content

Commit

Permalink
Git Tool: Add support for .mbx patches
Browse files Browse the repository at this point in the history
Update apply method to accept .mbx files. These
are generated by b4 tool.
  • Loading branch information
adityagesh committed Nov 15, 2024
1 parent 681f5bd commit 54a1749
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions lisa/tools/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,25 @@ def apply(
cwd: pathlib.PurePath,
patches: pathlib.PurePath,
) -> None:
result = self.run(
f"apply {patches}",
shell=True,
cwd=cwd,
force_run=True,
no_info_log=True,
no_error_log=True,
)
file_extension = patches.suffix
if file_extension == ".mbx":
result = self.run(
f"am {patches}",
shell=True,
cwd=cwd,
force_run=True,
no_info_log=True,
no_error_log=True,
)
else:
result = self.run(
f"apply {patches}",
shell=True,
cwd=cwd,
force_run=True,
no_info_log=True,
no_error_log=True,
)
result.assert_exit_code(message=f"failed on applying patches. {result.stdout}")

def list_tags(self, cwd: pathlib.PurePath) -> List[str]:
Expand Down

0 comments on commit 54a1749

Please sign in to comment.