aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--gogs.go2
-rw-r--r--models/access.go4
-rw-r--r--models/pull.go11
-rw-r--r--models/repo.go2
-rw-r--r--modules/middleware/repo.go5
-rwxr-xr-xpublic/css/gogs.css2
-rw-r--r--public/less/_markdown.less5
-rw-r--r--templates/.VERSION2
-rw-r--r--templates/repo/header_old.tmpl23
-rw-r--r--templates/repo/sidebar.tmpl6
-rw-r--r--templates/repo/view_file.tmpl2
12 files changed, 34 insertions, 32 deletions
diff --git a/README.md b/README.md
index 02e624c0a8..73e35c4b9d 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
![](public/img/gogs-large-resize.png)
-##### Current version: 0.7.10 Beta
+##### Current version: 0.7.11 Beta
<table>
<tr>
diff --git a/gogs.go b/gogs.go
index 95b8e931f4..04e1cf657d 100644
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
-const APP_VER = "0.7.10.1114 Beta"
+const APP_VER = "0.7.11.1115 Beta"
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
diff --git a/models/access.go b/models/access.go
index 9e8c2dfe69..8a7729b734 100644
--- a/models/access.go
+++ b/models/access.go
@@ -101,6 +101,10 @@ func (u *User) GetAccessibleRepositories() ([]*Repository, error) {
return nil, err
}
+ if len(accesses) == 0 {
+ return []*Repository{}, nil
+ }
+
repoIDs := make([]int64, 0, len(accesses))
for _, access := range accesses {
repoIDs = append(repoIDs, access.RepoID)
diff --git a/models/pull.go b/models/pull.go
index 56af5f828d..094cb9b26a 100644
--- a/models/pull.go
+++ b/models/pull.go
@@ -218,6 +218,7 @@ var patchConflicts = []string{
}
// 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)
@@ -243,8 +244,16 @@ func (pr *PullRequest) testPatch() (err error) {
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 {
diff --git a/models/repo.go b/models/repo.go
index fab463b948..bbd978ff4b 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -320,7 +320,7 @@ func (repo *Repository) UpdateLocalCopy() error {
}
} 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)
}
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go
index 1418486430..c7481743d4 100644
--- a/modules/middleware/repo.go
+++ b/modules/middleware/repo.go
@@ -79,6 +79,11 @@ func ApiRepoAssignment() macaron.Handler {
// RepoRef handles repository reference name including those contain `/`.
func RepoRef() macaron.Handler {
return func(ctx *Context) {
+ // Empty repository does not have reference information.
+ if ctx.Repo.Repository.IsBare {
+ return
+ }
+
var (
refName string
err error
diff --git a/public/css/gogs.css b/public/css/gogs.css
index 4e16ff6fd0..5ade64d921 100755
--- a/public/css/gogs.css
+++ b/public/css/gogs.css
@@ -1072,6 +1072,8 @@ footer .container .links > *:first-child {
font-size: 16px;
line-height: 1.6 !important;
word-wrap: break-word;
+}
+.markdown.file-view {
padding: 5px 2em 2em !important;
}
.markdown > *:first-child {
diff --git a/public/less/_markdown.less b/public/less/_markdown.less
index 6b88e48bd3..561fa20b1b 100644
--- a/public/less/_markdown.less
+++ b/public/less/_markdown.less
@@ -4,7 +4,10 @@
font-size: 16px;
line-height: 1.6 !important;
word-wrap: break-word;
- padding: 5px 2em 2em !important;
+
+ &.file-view {
+ padding: 5px 2em 2em !important;
+ }
>*:first-child {
margin-top: 0 !important;
diff --git a/templates/.VERSION b/templates/.VERSION
index 32d6c06db8..7b98f0fd88 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.7.10.1114 Beta \ No newline at end of file
+0.7.11.1115 Beta \ No newline at end of file
diff --git a/templates/repo/header_old.tmpl b/templates/repo/header_old.tmpl
index 23a3e0888d..7a51009573 100644
--- a/templates/repo/header_old.tmpl
+++ b/templates/repo/header_old.tmpl
@@ -10,29 +10,6 @@
{{if .IsFork}}<span class="fork-flag">forked from <a href="{{.BaseRepo.RepoLink}}">{{SubStr .BaseRepo.RepoLink 1 -1}}</a></span>{{end}}
</h1>
<ul id="repo-header-meta" class="right menu menu-line">
- <li id="repo-header-download" class="drop">
- <a id="repo-header-download-btn" href="#">
- <button class="btn btn-black text-bold btn-radius">
- <i class="octicon octicon-cloud-download"></i>
- </button>
- </a>
- <div id="repo-header-download-drop" class="drop-down">
- <div id="repo-clone" class="clear">
- {{if not $.DisableSSH}}
- <button class="btn btn-blue left btn-left-radius" id="repo-clone-ssh" data-link="{{$.CloneLink.SSH}}">SSH</button>
- {{end}}
- <button class="btn {{if $.DisableSSH}}btn-blue{{else}}btn-gray{{end}} left" id="repo-clone-https" data-link="{{$.CloneLink.HTTPS}}">HTTPS</button>
- <input id="repo-clone-url" class="ipt ipt-disabled left" value="{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}" onclick="this.select();" readonly />
- <button id="repo-clone-copy" class="btn btn-black left btn-right-radius" data-copy-val="val" data-copy-from="#repo-clone-url" original-title="{{$.i18n.Tr "repo.click_to_copy"}}" data-original-title="{{$.i18n.Tr "repo.click_to_copy"}}" data-after-title="{{$.i18n.Tr "repo.copied"}}">{{$.i18n.Tr "repo.copy_link"}}</button>
- <p class="text-center" id="repo-clone-help">{{$.i18n.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</p>
- <hr/>
- <div class="text-center" id="repo-clone-zip">
- <a class="btn btn-green btn-radius" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip"><i class="octicon octicon-file-zip"></i>ZIP</a>
- <a class="btn btn-green btn-radius" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i>TAR.GZ</a>
- </div>
- </div>
- </div>
- </li>
<li id="repo-header-watch">
<a id="repo-header-watch-btn" href="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch">
<button class="btn btn-gray text-bold btn-radius">
diff --git a/templates/repo/sidebar.tmpl b/templates/repo/sidebar.tmpl
index df033c0e15..2e4fdfb64e 100644
--- a/templates/repo/sidebar.tmpl
+++ b/templates/repo/sidebar.tmpl
@@ -1,4 +1,5 @@
-<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>
@@ -16,4 +17,5 @@
<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
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index 827e51931d..5751d2e3dd 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -24,7 +24,7 @@
{{end}}
</h4>
<div class="ui attached table segment">
- <div class="{{if .ReadmeExist}}markdown{{else if .IsFileText}}code-view{{end}}">
+ <div class="file-view {{if .ReadmeExist}}markdown{{else if .IsFileText}}code-view{{end}}">
{{if .ReadmeExist}}
{{if .FileContent}}{{.FileContent | Str2html}}{{end}}
{{else if not .IsFileText}}