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); }