From 7f65015e43e8ca924a6c671b38cee58f238d19ba Mon Sep 17 00:00:00 2001 From: John Davis Date: Mon, 19 Feb 2024 15:26:44 -0500 Subject: [PATCH] Abort no-commit merge only if not up-to-date --- galaxy_release_util/point_release.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/galaxy_release_util/point_release.py b/galaxy_release_util/point_release.py index 42b5e2d..34af2fa 100644 --- a/galaxy_release_util/point_release.py +++ b/galaxy_release_util/point_release.py @@ -462,9 +462,10 @@ def is_merge_required(base_branch: str, new_branch: str, galaxy_root: pathlib.Pa process = subprocess.run( ["git", "merge", "--no-commit", "--no-ff", base_branch], cwd=galaxy_root, - capture_output=False, + capture_output=True, ) - subprocess.run(["git", "merge", "--abort"], cwd=galaxy_root) + if not process.stdout == b"Already up to date.\n": + subprocess.run(["git", "merge", "--abort"], cwd=galaxy_root) if process.returncode == 0: return False return True