From cd5126d8c93fa69aa8465d8ed22971fcca78f33e Mon Sep 17 00:00:00 2001 From: Nurahmadie Date: Sun, 2 Mar 2014 17:46:02 +0700 Subject: [PATCH 1/2] Set author for pull request --- pkg/handler/hooks.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/handler/hooks.go b/pkg/handler/hooks.go index f7aaed24b..8a572d19f 100644 --- a/pkg/handler/hooks.go +++ b/pkg/handler/hooks.go @@ -230,6 +230,7 @@ func (h *HookHandler) PullRequestHook(w http.ResponseWriter, r *http.Request) { commit.Status = "Pending" commit.Created = time.Now().UTC() commit.Gravatar = hook.PullRequest.User.GravatarId + commit.Author = hook.PullRequest.User.Login commit.PullRequest = strconv.Itoa(hook.Number) commit.Message = hook.PullRequest.Title // label := p.PullRequest.Head.Labe From fe3bb972317821a300dfa3e00cead2feb68b04ca Mon Sep 17 00:00:00 2001 From: Nurahmadie Date: Sun, 2 Mar 2014 20:03:05 +0700 Subject: [PATCH 2/2] Fix pull-request checkout not working for Git >=1.8 Explicitly create pr branch from origin --- pkg/build/repo/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/build/repo/repo.go b/pkg/build/repo/repo.go index d1af38fac..af8e677c0 100644 --- a/pkg/build/repo/repo.go +++ b/pkg/build/repo/repo.go @@ -107,7 +107,7 @@ func (r *Repo) Commands() []string { case len(r.PR) > 0: cmds = append(cmds, fmt.Sprintf("git fetch origin +refs/pull/%s/head:refs/remotes/origin/pr/%s", r.PR, r.PR)) - cmds = append(cmds, fmt.Sprintf("git checkout -qf pr/%s", r.PR)) + cmds = append(cmds, fmt.Sprintf("git checkout -qf -b pr/%s origin/pr/%s", r.PR, r.PR)) //cmds = append(cmds, fmt.Sprintf("git fetch origin +refs/pull/%s/merge:", r.PR)) //cmds = append(cmds, fmt.Sprintf("git checkout -qf %s", "FETCH_HEAD")) // if a specific commit is provided then we'll