зеркало из https://github.com/mislav/hub.git
Merge pull request jingweno/gh:65 from jingweno/fix_merge_msg_number
Fix merge message number
This commit is contained in:
Коммит
67eb2f9209
|
@ -58,7 +58,7 @@ func fetchAndMerge(args *Args, pullRequest *octokat.PullRequest) error {
|
|||
mergeHead := fmt.Sprintf("%s/%s", user, branch)
|
||||
ref := fmt.Sprintf("+refs/heads/%s:refs/remotes/%s", branch, mergeHead)
|
||||
args.Before("git", "fetch", url, ref)
|
||||
mergeMsg := fmt.Sprintf("Merge pull request #%v from %s\n\n%s", pullRequest.Id, mergeHead, pullRequest.Title)
|
||||
mergeMsg := fmt.Sprintf("Merge pull request #%v from %s\n\n%s", pullRequest.Number, mergeHead, pullRequest.Title)
|
||||
args.AppendParams(mergeHead, "--no-ff", "-m", mergeMsg)
|
||||
|
||||
return nil
|
||||
|
|
|
@ -8,12 +8,11 @@ import (
|
|||
|
||||
func TestFetchAndMerge(t *testing.T) {
|
||||
url := "https://github.com/jingweno/gh/pull/73"
|
||||
number := 73
|
||||
title := "title"
|
||||
|
||||
args := NewArgs([]string{"merge", url})
|
||||
|
||||
id := 73
|
||||
title := "title"
|
||||
|
||||
userLogin := "jingweno"
|
||||
user := octokat.User{Login: userLogin}
|
||||
|
||||
|
@ -23,7 +22,7 @@ func TestFetchAndMerge(t *testing.T) {
|
|||
headRef := "new-feature"
|
||||
head := octokat.Commit{Ref: headRef, Repo: repo}
|
||||
|
||||
pullRequest := octokat.PullRequest{Id: id, Title: title, HTMLURL: url, User: user, Head: head}
|
||||
pullRequest := octokat.PullRequest{Number: number, Title: title, HTMLURL: url, User: user, Head: head}
|
||||
|
||||
err := fetchAndMerge(args, &pullRequest)
|
||||
assert.Equal(t, nil, err)
|
||||
|
|
Загрузка…
Ссылка в новой задаче