aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Gopkg.lock4
-rw-r--r--options/locale/locale_en-US.ini1
-rw-r--r--templates/repo/commits_table.tmpl12
-rw-r--r--templates/repo/pulls/compare.tmpl3
-rw-r--r--vendor/code.gitea.io/git/hook.go13
-rw-r--r--vendor/code.gitea.io/git/repo_pull.go27
6 files changed, 41 insertions, 19 deletions
diff --git a/Gopkg.lock b/Gopkg.lock
index 6a97f8915c..42b4a3ae94 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -3,11 +3,11 @@
[[projects]]
branch = "master"
- digest = "1:e1fa64238b0a2dbf1edf98c4af8d1b8cb65179e286d7f28006b50fa9f508ee9d"
+ digest = "1:c298eea5ff7f6ab40cda6fe75d2224e2dd271941abe2f66276063b39e43e5687"
name = "code.gitea.io/git"
packages = ["."]
pruneopts = "NUT"
- revision = "74d7c14dd4a3ed9c5def0dc3c1aeede399ddc5c5"
+ revision = "63b74d438b29bb272fa9b4010abe3f50a832e7ef"
[[projects]]
branch = "master"
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index 6662400ad9..0dc8848967 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -683,6 +683,7 @@ editor.cannot_commit_to_protected_branch = Cannot commit to protected branch '%s
commits.desc = Browse source code change history.
commits.commits = Commits
+commits.no_commits = No commits in common. '%s' and '%s' have entirely different histories.
commits.search = Search commits…
commits.find = Search
commits.search_all = All Branches
diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl
index 53c2f98f4d..55c550ae95 100644
--- a/templates/repo/commits_table.tmpl
+++ b/templates/repo/commits_table.tmpl
@@ -1,9 +1,13 @@
<h4 class="ui top attached header">
<div class="ui stackable grid">
- <div class="six wide column">
- {{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}} {{if .Branch}}({{.Branch}}){{end}}
+ <div class="ten wide column">
+ {{if or .PageIsCommits (gt .CommitCount 0)}}
+ {{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}} {{if .Branch}}({{.Branch}}){{end}}
+ {{else}}
+ {{.i18n.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch }} {{if .Branch}}({{.Branch}}){{end}}
+ {{end}}
</div>
- <div class="ten wide right aligned column">
+ <div class="six wide right aligned column">
{{if .PageIsCommits}}
<form class="ignore-dirty" action="{{.RepoLink}}/commits/{{.BranchNameSubURL | EscapePound}}/search">
<div class="ui tiny search input">
@@ -23,7 +27,7 @@
</div>
</h4>
-{{if .Commits}}
+{{if and .Commits (gt .CommitCount 0)}}
<div class="ui attached table segment">
<table class="ui very basic striped fixed table single line" id="commits-table">
<thead>
diff --git a/templates/repo/pulls/compare.tmpl b/templates/repo/pulls/compare.tmpl
index d2e00ace36..2296acf1df 100644
--- a/templates/repo/pulls/compare.tmpl
+++ b/templates/repo/pulls/compare.tmpl
@@ -54,6 +54,9 @@
<div class="ui segment">
{{.i18n.Tr "repo.pulls.has_pull_request" $.RepoLink $.RepoRelPath .PullRequest.Index | Safe}}
</div>
+ {{else if eq .CommitCount 0 }}
+ {{template "repo/commits_table" .}}
+ {{template "repo/diff/box" .}}
{{else}}
{{template "repo/issue/new_form" .}}
{{template "repo/commits_table" .}}
diff --git a/vendor/code.gitea.io/git/hook.go b/vendor/code.gitea.io/git/hook.go
index afed623e6e..18c00b5838 100644
--- a/vendor/code.gitea.io/git/hook.go
+++ b/vendor/code.gitea.io/git/hook.go
@@ -82,11 +82,20 @@ func (h *Hook) Name() string {
func (h *Hook) Update() error {
if len(strings.TrimSpace(h.Content)) == 0 {
if isExist(h.path) {
- return os.Remove(h.path)
+ err := os.Remove(h.path)
+ if err != nil {
+ return err
+ }
}
+ h.IsActive = false
return nil
}
- return ioutil.WriteFile(h.path, []byte(strings.Replace(h.Content, "\r", "", -1)), os.ModePerm)
+ err := ioutil.WriteFile(h.path, []byte(strings.Replace(h.Content, "\r", "", -1)), os.ModePerm)
+ if err != nil {
+ return err
+ }
+ h.IsActive = true
+ return nil
}
// ListHooks returns a list of Git hooks of given repository.
diff --git a/vendor/code.gitea.io/git/repo_pull.go b/vendor/code.gitea.io/git/repo_pull.go
index c6d97a6fd1..65c5414551 100644
--- a/vendor/code.gitea.io/git/repo_pull.go
+++ b/vendor/code.gitea.io/git/repo_pull.go
@@ -48,17 +48,22 @@ func (repo *Repository) GetPullRequestInfo(basePath, baseBranch, headBranch stri
prInfo := new(PullRequestInfo)
prInfo.MergeBase, err = repo.GetMergeBase(remoteBranch, headBranch)
- if err != nil {
- return nil, fmt.Errorf("GetMergeBase: %v", err)
- }
-
- logs, err := NewCommand("log", prInfo.MergeBase+"..."+headBranch, prettyLogFormat).RunInDirBytes(repo.Path)
- if err != nil {
- return nil, err
- }
- prInfo.Commits, err = repo.parsePrettyFormatLogToList(logs)
- if err != nil {
- return nil, fmt.Errorf("parsePrettyFormatLogToList: %v", err)
+ if err == nil {
+ // We have a common base
+ logs, err := NewCommand("log", prInfo.MergeBase+"..."+headBranch, prettyLogFormat).RunInDirBytes(repo.Path)
+ if err != nil {
+ return nil, err
+ }
+ prInfo.Commits, err = repo.parsePrettyFormatLogToList(logs)
+ if err != nil {
+ 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.
t/40394/stable30 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/apps/encryption/tests/Settings/AdminTest.php
blob: 4ddaeb1b84dd9866a6731882b3d5a3c44679fdfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83