Skip to content

Commit

Permalink
bin/merge-driver-ekeyword: replace os.system with os.execlp
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Gilbert <[email protected]>
  • Loading branch information
floppym committed Aug 29, 2023
1 parent fb45df3 commit 6798375
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bin/merge-driver-ekeyword
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,10 @@ def main(argv: Sequence[str]) -> int:
result = apply_keyword_changes(A, P, changes)
sys.exit(result)
else:
result = os.system(f"git merge-file -L HEAD -L base -L ours {A} {O} {B}")
result = os.waitstatus_to_exitcode(result)
if result < 0 or result >= 128:
try:
os.execlp("git", "git", "merge-file", "-L", "HEAD", "-L", "base", "-L", "ours", A, O, B)
except OSError:
sys.exit(-1)
sys.exit(result)

if __name__ == "__main__":
main(sys.argv)

0 comments on commit 6798375

Please sign in to comment.