Skip to content

Commit c104e50

Browse files
committed
Merge remote-tracking branch 'origin/master' into must_change_password_cli
2 parents d2bc4de + 378af8e commit c104e50

File tree

46 files changed

+1001
-241
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1001
-241
lines changed

Gopkg.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@ Peter Žeby <[email protected]> (@morlinest)
2222
Matti Ranta <[email protected]> (@techknowlogick)
2323
Michael Lustfield <[email protected]> (@MTecknology)
2424
Jonas Franz <[email protected]> (@JonasFranzDEV)
25-
Flynn Lufmons <[email protected]> (@flufmonster)
2625
Alexey Terentyev <[email protected]> (@axifive)
2726
Lanre Adelowo <[email protected]> (@adelowo)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This project has been
2929

3030
From the root of the source tree, run:
3131

32-
make generate all
32+
TAGS="bindata" make generate all
3333

3434
More info: https://docs.gitea.io/en-us/install-from-source/
3535

custom/conf/app.ini.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ DEFAULT_THEME = gitea
9191
USER_PAGING_NUM = 50
9292
; Number of repos that are displayed on one page
9393
REPO_PAGING_NUM = 50
94-
; Number of notices that are displayed on in one page
94+
; Number of notices that are displayed on one page
9595
NOTICE_PAGING_NUM = 25
9696
; Number of organizations that are displayed on one page
9797
ORG_PAGING_NUM = 50

docs/content/doc/installation/with-docker.en-us.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ image as a service. Since there is no database available one can be initialized
3030
Create a directory like `gitea` and paste the following content into a file named `docker-compose.yml`.
3131
Note that the volume should be owned by the user/group with the UID/GID specified in the config file.
3232
If you don't give the volume correct permissions, the container may not start.
33+
Also be aware that the tag `:latest` will install the current development version.
34+
For a stable release you can use `:1` or specify a certain release like `:1.5.1`.
3335

3436
```yaml
3537
version: "2"
@@ -103,6 +105,11 @@ services:
103105
environment:
104106
- USER_UID=1000
105107
- USER_GID=1000
108+
+ - DB_TYPE=mysql
109+
+ - DB_HOST=db:3306
110+
+ - DB_NAME=gitea
111+
+ - DB_USER=gitea
112+
+ - DB_PASSWD=gitea
106113
restart: always
107114
networks:
108115
- gitea
@@ -146,6 +153,11 @@ services:
146153
environment:
147154
- USER_UID=1000
148155
- USER_GID=1000
156+
+ - DB_TYPE=postgres
157+
+ - DB_HOST=db:5432
158+
+ - DB_NAME=gitea
159+
+ - DB_USER=gitea
160+
+ - DB_PASSWD=gitea
149161
restart: always
150162
networks:
151163
- gitea

models/fixtures/comment.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,14 @@
4141
tree_path: "README.md"
4242
created_unix: 946684812
4343
invalidated: false
44+
45+
-
46+
id: 6
47+
type: 21 # code comment
48+
poster_id: 1
49+
issue_id: 2
50+
content: "it's already invalidated. boring..."
51+
line: -4
52+
tree_path: "README.md"
53+
created_unix: 946684812
54+
invalidated: true

models/gpg_key.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ func verifySign(s *packet.Signature, h hash.Hash, k *GPGKey) error {
360360

361361
// ParseCommitWithSignature check if signature is good against keystore.
362362
func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
363-
if c.Signature != nil {
363+
if c.Signature != nil && c.Committer != nil {
364364
//Parsing signature
365365
sig, err := extractSignature(c.Signature.Signature)
366366
if err != nil { //Skipping failed to extract sign

models/issue_comment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ func fetchCodeCommentsByReview(e Engine, issue *Issue, currentUser *User, review
10841084
}
10851085
conds := opts.toConds()
10861086
if review.ID == 0 {
1087-
conds.And(builder.Eq{"invalidated": false})
1087+
conds = conds.And(builder.Eq{"invalidated": false})
10881088
}
10891089

10901090
var comments []*Comment

models/issue_milestone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func (milestones MilestoneList) getMilestoneIDs() []int64 {
181181
// GetMilestonesByRepoID returns all milestones of a repository.
182182
func GetMilestonesByRepoID(repoID int64) (MilestoneList, error) {
183183
miles := make([]*Milestone, 0, 10)
184-
return miles, x.Where("repo_id = ?", repoID).Find(&miles)
184+
return miles, x.Where("repo_id = ?", repoID).Asc("deadline_unix").Find(&miles)
185185
}
186186

187187
// GetMilestones returns a list of milestones of given repository and status.

modules/base/tool.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,22 @@ func DetectEncoding(content []byte) (string, error) {
5959
return "UTF-8", nil
6060
}
6161

62-
result, err := chardet.NewTextDetector().DetectBest(content)
62+
textDetector := chardet.NewTextDetector()
63+
var detectContent []byte
64+
if len(content) < 1024 {
65+
// Check if original content is valid
66+
if _, err := textDetector.DetectBest(content); err != nil {
67+
return "", err
68+
}
69+
times := 1024 / len(content)
70+
detectContent = make([]byte, 0, times*len(content))
71+
for i := 0; i < times; i++ {
72+
detectContent = append(detectContent, content...)
73+
}
74+
} else {
75+
detectContent = content
76+
}
77+
result, err := textDetector.DetectBest(detectContent)
6378
if err != nil {
6479
return "", err
6580
}

0 commit comments

Comments
 (0)