提交 dee84576 编写于 作者: B Brett V. Forsgren

fix message for fixing merge conflicts

also make merge branch name easier to read, changing from
  `master-future-2015-01-01-00-00-00`
to
  `merge-master-into-future-20150101-000000`
上级 d74be70f
......@@ -22,7 +22,7 @@ static async Task<string> GetShaFromBranch(GitHubClient github, string user, str
/// <returns> The name of the branch that was created </returns>
static async Task<string> MakePrBranch(GitHubClient github, string user, string repo, string sha, string branchNamePrefix)
{
var branchName = branchNamePrefix + DateTime.UtcNow.ToString("yyyy-MM-dd-HH-mm-ss");
var branchName = branchNamePrefix + DateTime.UtcNow.ToString("yyyyMMdd-HHmmss");
var resp = await github.Connection.Post<string>(
uri: new Uri($"https://api.github.com/repos/{user}/{repo}/git/refs"),
......@@ -55,10 +55,11 @@ static async Task<string> MakePrBranch(GitHubClient github, string user, string
git remote add roslyn-bot ""https://github.com/roslyn-bot/roslyn.git""
git fetch roslyn-bot
git checkout {newBranchName}
git pull upstream {intoBranch}
git reset --hard upstream/{intoBranch}
git merge upstream/{fromBranch}
# Fix merge conflicts
git commit
git push roslyn-bot {newBranchName} -f
git push roslyn-bot {newBranchName} --force
```
Once the merge can be made and all the tests pass, you are free to merge the pull request.
......@@ -71,7 +72,7 @@ static async Task MakePullRequest(GitHubClient github, string remoteUser, string
{
var remoteIntoBranch = await GetShaFromBranch(github, remoteUser, repoName, fromBranch);
var newBranchName = await MakePrBranch(github, myUser, repoName, remoteIntoBranch, $"{fromBranch}-{intoBranch}");
var newBranchName = await MakePrBranch(github, myUser, repoName, remoteIntoBranch, $"merge-{fromBranch}-into-{intoBranch}");
await SubmitPullRequest(github, remoteUser, myUser, repoName, newBranchName, fromBranch, intoBranch);
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册