}
// testPatch checks if patch can be merged to base repository without conflit.
+// FIXME: make a mechanism to clean up stable local copies.
func (pr *PullRequest) testPatch() (err error) {
if pr.BaseRepo == nil {
pr.BaseRepo, err = GetRepositoryByID(pr.BaseRepoID)
return fmt.Errorf("UpdateLocalCopy: %v", err)
}
- pr.Status = PULL_REQUEST_STATUS_CHECKING
+ // Checkout base branch.
_, stderr, err := process.ExecDir(-1, pr.BaseRepo.LocalCopyPath(),
+ fmt.Sprintf("PullRequest.Merge(git checkout): %s", pr.BaseRepo.ID),
+ "git", "checkout", pr.BaseBranch)
+ if err != nil {
+ return fmt.Errorf("git checkout: %s", stderr)
+ }
+
+ pr.Status = PULL_REQUEST_STATUS_CHECKING
+ _, stderr, err = process.ExecDir(-1, pr.BaseRepo.LocalCopyPath(),
fmt.Sprintf("testPatch(git apply --check): %d", pr.BaseRepo.ID),
"git", "apply", "--check", patchPath)
if err != nil {
}
} else {
_, stderr, err := process.ExecDir(-1, localPath,
- fmt.Sprintf("UpdateLocalCopy(git pull): %s", repoPath), "git", "pull")
+ fmt.Sprintf("UpdateLocalCopy(git pull --all): %s", repoPath), "git", "pull", "--all")
if err != nil {
return fmt.Errorf("git pull: %v - %s", err, stderr)
}
-<div class="ui five item menu">
+{{if not .IsBareRepo}}
+<div class="ui {{if .IsRepositoryAdmin}}five{{else}}four{{end}} item menu">
<a class="item" href="{{.RepoLink}}/issues">
<i class="icon octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} <span class="ui blue label">{{.Repository.NumOpenIssues}}</span>
</a>
<i class="icon octicon octicon-tools"></i> {{.i18n.Tr "repo.settings"}}
</a>
{{end}}
-</div>
\ No newline at end of file
+</div>
+{{end}}
\ No newline at end of file