Skip to content

Commit b174273

Browse files
committed
Merge remote-tracking branch 'origin/master' into fail_if_collaborator_already_exists
2 parents 618dabd + 9ea327f commit b174273

Some content is hidden

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

51 files changed

+2319
-198
lines changed

custom/conf/app.ini.sample

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ ISSUE_PAGING_NUM = 10
6969
FEED_MAX_COMMIT_NUM = 5
7070
; Number of maximum commits displayed in commit graph.
7171
GRAPH_MAX_COMMIT_NUM = 100
72+
; Number of line of codes shown for a code comment
73+
CODE_COMMENT_LINES = 4
7274
; Value of `theme-color` meta tag, used by Android >= 5.0
7375
; An invalid color like "none" or "disable" will have the default style
7476
; More info: https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android

docs/content/doc/features/comparison.en-us.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ _Symbols used in table:_
9292
| Pull/Merge requests ||||||||
9393
| Squash merging ||||||||
9494
| Rebase merging ||||||||
95-
| Pull/Merge request inline comments | |||||||
96-
| Pull/Merge request approval | |||||||
95+
| Pull/Merge request inline comments | |||||||
96+
| Pull/Merge request approval | |||||||
9797
| Merge conflict resolution ||||||||
9898
| Restrict push and merge access to certain users ||||||||
9999
| Revert specific commits or a merge request ||||||||

docs/content/doc/installation/from-binary.en-us.md

+36
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,20 @@ cp gitea /usr/local/bin/gitea
9090

9191
See how to create [Linux service]({{< relref "run-as-service-in-ubuntu.en-us.md" >}})
9292

93+
## Updating to a new version
94+
95+
You can update to a new version of gitea by stopping gitea, replacing the binary at `/usr/local/bin/gitea` and restarting the instance.
96+
The binary file name should not be changed during the update to avoid problems
97+
in existing repositories.
98+
99+
It is recommended you do a [backup]({{< relref "doc/usage/backup-and-restore.en-us.md" >}}) before updating your installation.
100+
101+
If you have carried out the installation steps as described above, the binary should
102+
have the generic name `gitea`. Do not change this, i.e. to include the version number.
103+
104+
See below for troubleshooting instructions to repair broken repositories after
105+
an update of your gitea version.
106+
93107
## Troubleshooting
94108

95109
### Old glibc versions
@@ -107,3 +121,25 @@ For errors like `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:30
107121
bind: address already in use` gitea needs to be started on another free port. This
108122
is possible using `./gitea web -p $PORT`. It's possible another instance of gitea
109123
is already running.
124+
125+
### Git error after updating to a new version of gitea
126+
127+
If the binary file name has been changed during the update to a new version of gitea,
128+
git hooks in existing repositories will not work any more. In that case, a git
129+
error will be displayed when pushing to the repository.
130+
131+
```
132+
remote: ./hooks/pre-receive.d/gitea: line 2: [...]: No such file or directory
133+
```
134+
135+
The `[...]` part of the error message will contain the path to your previous gitea
136+
binary.
137+
138+
To solve this, go to the admin options and run the task `Resynchronize pre-receive,
139+
update and post-receive hooks of all repositories` to update all hooks to contain
140+
the new binary path. Please note that this overwrite all git hooks including ones
141+
with customizations made.
142+
143+
If you aren't using the built-in to Gitea ssh server you will also need to re-write
144+
the authorized key file by running the `Update the '.ssh/authorized_keys' file with
145+
Gitea SSH keys.` task in the admin options.

models/error.go

+22
Original file line numberDiff line numberDiff line change
@@ -1344,3 +1344,25 @@ func IsErrUnknownDependencyType(err error) bool {
13441344
func (err ErrUnknownDependencyType) Error() string {
13451345
return fmt.Sprintf("unknown dependency type [type: %d]", err.Type)
13461346
}
1347+
1348+
// __________ .__
1349+
// \______ \ _______ _|__| ______ _ __
1350+
// | _// __ \ \/ / |/ __ \ \/ \/ /
1351+
// | | \ ___/\ /| \ ___/\ /
1352+
// |____|_ /\___ >\_/ |__|\___ >\/\_/
1353+
// \/ \/ \/
1354+
1355+
// ErrReviewNotExist represents a "ReviewNotExist" kind of error.
1356+
type ErrReviewNotExist struct {
1357+
ID int64
1358+
}
1359+
1360+
// IsErrReviewNotExist checks if an error is a ErrReviewNotExist.
1361+
func IsErrReviewNotExist(err error) bool {
1362+
_, ok := err.(ErrReviewNotExist)
1363+
return ok
1364+
}
1365+
1366+
func (err ErrReviewNotExist) Error() string {
1367+
return fmt.Sprintf("review does not exist [id: %d]", err.ID)
1368+
}

models/fixtures/comment.yml

+21
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,24 @@
2020
issue_id: 1 # in repo_id 1
2121
content: "meh..."
2222
created_unix: 946684812
23+
-
24+
id: 4
25+
type: 21 # code comment
26+
poster_id: 1
27+
issue_id: 2
28+
content: "meh..."
29+
review_id: 4
30+
line: 4
31+
tree_path: "README.md"
32+
created_unix: 946684812
33+
invalidated: false
34+
-
35+
id: 5
36+
type: 21 # code comment
37+
poster_id: 1
38+
issue_id: 2
39+
content: "meh..."
40+
line: -4
41+
tree_path: "README.md"
42+
created_unix: 946684812
43+
invalidated: false

models/fixtures/review.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
-
2+
id: 1
3+
type: 1
4+
reviewer_id: 1
5+
issue_id: 2
6+
content: "Demo Review"
7+
updated_unix: 946684810
8+
created_unix: 946684810
9+
-
10+
id: 2
11+
type: 1
12+
reviewer_id: 534543
13+
issue_id: 534543
14+
content: "Invalid Review #1"
15+
updated_unix: 946684810
16+
created_unix: 946684810
17+
-
18+
id: 3
19+
type: 1
20+
reviewer_id: 1
21+
issue_id: 343545
22+
content: "Invalid Review #2"
23+
updated_unix: 946684810
24+
created_unix: 946684810
25+
-
26+
id: 4
27+
type: 0 # Pending review
28+
reviewer_id: 1
29+
issue_id: 2
30+
content: "Pending Review"
31+
updated_unix: 946684810
32+
created_unix: 946684810

0 commit comments

Comments
 (0)