|
|
@ -48,10 +48,8 @@ func (repo *Repository) GetPullRequestInfo(basePath, baseBranch, headBranch stri |
|
|
|
|
|
|
|
|
|
|
|
prInfo := new(PullRequestInfo) |
|
|
|
prInfo := new(PullRequestInfo) |
|
|
|
prInfo.MergeBase, err = repo.GetMergeBase(remoteBranch, headBranch) |
|
|
|
prInfo.MergeBase, err = repo.GetMergeBase(remoteBranch, headBranch) |
|
|
|
if err != nil { |
|
|
|
if err == nil { |
|
|
|
return nil, fmt.Errorf("GetMergeBase: %v", err) |
|
|
|
// We have a common base
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logs, err := NewCommand("log", prInfo.MergeBase+"..."+headBranch, prettyLogFormat).RunInDirBytes(repo.Path) |
|
|
|
logs, err := NewCommand("log", prInfo.MergeBase+"..."+headBranch, prettyLogFormat).RunInDirBytes(repo.Path) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
@ -60,6 +58,13 @@ func (repo *Repository) GetPullRequestInfo(basePath, baseBranch, headBranch stri |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, fmt.Errorf("parsePrettyFormatLogToList: %v", err) |
|
|
|
return nil, fmt.Errorf("parsePrettyFormatLogToList: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
prInfo.Commits = list.New() |
|
|
|
|
|
|
|
prInfo.MergeBase, err = GetFullCommitID(repo.Path, remoteBranch) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
prInfo.MergeBase = remoteBranch |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Count number of changed files.
|
|
|
|
// Count number of changed files.
|
|
|
|
stdout, err := NewCommand("diff", "--name-only", remoteBranch+"..."+headBranch).RunInDir(repo.Path) |
|
|
|
stdout, err := NewCommand("diff", "--name-only", remoteBranch+"..."+headBranch).RunInDir(repo.Path) |
|
|
|