You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Command/PullRequest/PullRequestMergeCommand.php
+18-4Lines changed: 18 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,7 @@ protected function configure()
42
42
->addOption('force-squash', null, InputOption::VALUE_NONE, 'Force squashing the PR, even if there are multiple authors (this will implicitly use --squash)')
43
43
->addOption('switch', null, InputOption::VALUE_REQUIRED, 'Switch the base of the pull request before merging')
44
44
->addOption('pat', null, InputOption::VALUE_REQUIRED, 'Give the PR\'s author a pat on the back after the merge')
45
+
->addOption('remove-source-branch', null, InputOption::VALUE_NONE, 'Remove remote source branch after merging own pull request')
45
46
->setHelp(
46
47
<<<'EOF'
47
48
The <info>%command.name%</info> command merges the given pull request:
@@ -99,6 +100,11 @@ protected function configure()
99
100
which has precedence to the predefined configuration.
100
101
101
102
<comment>The whole pat configuration will be ignored and no pat will be placed if the pull request is authored by yourself!</comment>
103
+
104
+
If you are the author of the pull request, <comment>--remove-source-branch</comment> can be used in order to remove the remote source
if ($removeSourceBranch && $pr['user'] !== $authenticatedUser) {
153
+
thrownewUserException(sprintf('`--remove-source-branch` option cannot be used with pull requests that aren\'t owned by the authenticated user (%s)', $authenticatedUser));
0 commit comments