Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,7 @@ protected function pushToGitHub(string $name, string $directory, InputInterface
$branch = $input->getOption('branch') ?: $this->defaultBranch();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this variable $branch (or even the whole line) useless now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. But it's not necessary here anymore since the --push flag will push the new branch to the repo with the same name. This was more a fallback for how the old way worked.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this line: ea0b3b6


$commands = [
"gh repo create {$name} --source=. {$flags}",
"git -c credential.helper= -c credential.helper='!gh auth git-credential' push -q -u origin {$branch}",
"gh repo create {$name} --source=. --push {$flags}",
];

$this->runCommands($commands, $input, $output, ['GIT_TERMINAL_PROMPT' => 0]);
Expand Down