From ad837e6b578dae05c78adff077c7c49c8c15114e Mon Sep 17 00:00:00 2001 From: Jonathon Byrdziak Date: Wed, 25 Mar 2026 21:27:49 -0700 Subject: [PATCH] Fix Git::remoteName() to prefer origin over other remotes Repos with multiple remotes (e.g. origin + launchpad) would use whichever remote appeared first alphabetically, causing releases to push to the wrong remote. Co-Authored-By: Claude Opus 4.6 --- src/Helpers/Git.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Helpers/Git.php b/src/Helpers/Git.php index 7482eb8..f211f89 100644 --- a/src/Helpers/Git.php +++ b/src/Helpers/Git.php @@ -150,7 +150,10 @@ public static function remoteName( $repo_dir = false ) { $flag = self::repoFlag($repo_dir); $remotes = Shell::run("git $flag remote 2>/dev/null"); - $remotearray = explode(PHP_EOL, $remotes); + $remotearray = array_filter(explode(PHP_EOL, $remotes)); + if (in_array('origin', $remotearray)) { + return 'origin'; + } return array_shift($remotearray); }