Skip to content

Commit

Permalink
Merge pull request #19448 from drognanar/mergeempty
Browse files Browse the repository at this point in the history
Delete the PR branch if nothing to merge
  • Loading branch information
drognanar authored May 15, 2017
2 parents bf7aaaf + 6e011f2 commit efd193c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Tools/Github/GithubMergeTool/GithubMergeTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ git push {prBranchName} --force
// 422 (Unprocessable Entity) indicates there were no commits to merge
if (response.StatusCode == (HttpStatusCode)422)
{
// Delete the pr branch if the PR was not created.
await _client.DeleteAsync($"repos/{repoOwner}/{repoName}/git/refs/heads/{prBranchName}");
return response;
}

Expand Down

0 comments on commit efd193c

Please sign in to comment.