diff options
author | Mike Gilbert <floppym@gentoo.org> | 2023-08-29 11:25:55 -0400 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2023-08-29 11:41:11 -0400 |
commit | 67983750f9014d5b1821b9cd2522b34f04ce1795 (patch) | |
tree | dd64ebb9359bc3c8faf812b0371ce9508c5d76f2 | |
parent | bin/merge-driver-ekeyword: mangle exit code correctly (diff) | |
download | gentoolkit-67983750f9014d5b1821b9cd2522b34f04ce1795.tar.gz gentoolkit-67983750f9014d5b1821b9cd2522b34f04ce1795.tar.bz2 gentoolkit-67983750f9014d5b1821b9cd2522b34f04ce1795.zip |
bin/merge-driver-ekeyword: replace os.system with os.execlp
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
-rwxr-xr-x | bin/merge-driver-ekeyword | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/merge-driver-ekeyword b/bin/merge-driver-ekeyword index 0235a98..ae022f3 100755 --- a/bin/merge-driver-ekeyword +++ b/bin/merge-driver-ekeyword @@ -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) |