Commit Graph

7819 Commits

Author SHA1 Message Date
mrsdizzie
2ef37522b6 Update Github Migration Test (#8946)
Small fix for test on 1.9 since #8938 can't be easily back ported to
this branch.
2019-11-13 12:33:33 +08:00
zeripath
46ff639a13
Fix issue with user.fullname (#8904) 2019-11-10 00:22:21 +00:00
guillep2k
0b91aaf62a Update Github migration test (#8897)
Earlier today #716 was reopened which updated the modification time for
an old milestone (1.6.0) that we use in testing with the assumption that
it is old and won't change. This breaks all builds now, so remove this
test since we have others that test the same code and this milestone
will likely be updated again as that issue changes etc...
2019-11-09 15:14:40 -05:00
Lunny Xiao
4a08d574cf fix 500 when edit hook (#8782) (#8790) 2019-11-02 14:31:29 -04:00
zeripath
f104898989 Allow to merge if file path contains " or \ (#8629) (#8772)
* if a filename in a repository contains " or \ the owner can't merge pull request with this files
because "git diff-tree" adds double quotes to that filepath
example: filepath is ab"cd but "git diff-tree" returns "ab\"cd"

now, when the owner click "Merge Pull Request" button the server returns 500
this commit fix it

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* add -z option to getDiffTree
escape spec symbols for sparse-checkout

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* go fmt

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* typo

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* escape '\'
escape all spaces and '!'

* use regexp.ReplaceAllString()

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* strings.ReplaceAll was added in go 1.12

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* add '\' to regexp.MustCompile

Signed-off-by: Ilya Pavlov <ilux@cpan.org>
2019-11-01 13:50:49 -04:00
John Olheiser
83d04df365 Changelog 1.9.5 (#8753)
* 1.9.5

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-10-30 17:40:15 +00:00
6543
9614bb1b9f [Backport] [Fix] milestone close timestamp (#8728) (#8731)
* [Fix] milestone close timestamp (#8728)

* BugFix: Update closed_date_unix colum on milestone table on close

* use go standart time lib

* make backport work!
2019-10-29 13:24:24 +08:00
David Svantesson
b2c3a7d79f Fix deadline on update issue or PR via API (#8699) 2019-10-28 01:36:28 +02:00
jaqra
76bbcf1387 make call createMilestoneComment on newIssue func (#8678) (#8682)
* make call createMilestoneComment on newIssue func

* make OldMilestoneID 0 instead of -1
2019-10-25 11:10:28 +01:00
Lunny Xiao
1bcbc02045 Revert "API should follow RequireSignInView (#8654) (#8661)" (#8674)
This reverts commit ffff835b73.
2019-10-24 22:07:13 +01:00
Monty Taylor
66ceee08dc Fix 500 when getting user as unauthenticated user (#8662)
When doing GET /api/v1/users/{user} as an unauthenticated user,
gitea throws a 500 because it's trying to dereference elements
from the context user. It wants to do this to see whether to
show the primary email and will do that if the logged in user
is admin or the user in question. However, if ctx.User is nil,
go gets really unhappy.
2019-10-24 16:25:30 +08:00
Lunny Xiao
ffff835b73
API should follow RequireSignInView (#8654) (#8661) 2019-10-24 14:57:24 +08:00
Lunny Xiao
63c54f7e1f Hide some user information via API if user have no enough permission (#8655) (#8658)
* Hide some user information via API if user have no enough permission

* fix test
2019-10-24 09:01:40 +03:00
zeripath
f9845454cf Use AppSubUrl for more redirections (#8647) (#8652)
Partial backport without changes to locale files.

Fix #8461 - fix misspelling of {{AppSubUrl}} and other misspelling in template
Fixes /explore and organisation redirection
2019-10-23 18:26:54 -04:00
John Olheiser
1e1211c194 Add SubURL to redirect path (#8632) (#8634) (#8640)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-10-23 07:11:29 +01:00
zeripath
10e549df7d
Update heatmap fixtures to restore tests (#8615) (#8617)
* Update heatmap fixtures to restore tests
* Add hint to check the fixture age on fail
2019-10-21 22:19:27 +01:00
6543
519f69eb41 Fix #8582 by handling empty repos (#8587) (#8593)
* Fix #8582 by handling empty repos

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Fix tests

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2019-10-19 22:07:12 +03:00
Lunny Xiao
d4501ece55
fix bug pull request files will be broken if head repo was transfered to another user or orgnization (#8571) 2019-10-18 16:14:37 +08:00
zeripath
c1152b15fe Add missed close in ServeBlobLFS (#8527) (#8543) 2019-10-17 00:05:23 +08:00
zeripath
cb31f88383 Fixes #8369: Create .ssh dir as necessary (#8486) (#8489)
* Ensure .ssh dir exists before rewriting public keys

* Ensure .ssh dir exists before appending to authorized_keys

* Log the error because it would be useful to know where it is trying to MkdirAll

* Only try to create RootPath if it's not empty
2019-10-13 23:01:52 +03:00
zeripath
6cb9ce1367 IsBranchExist: return false if provided name is empty (#8485) (#8492)
* IsBranchExist: return false if provided name is empty

* Ensure that the reference returned is actually of a valid type
2019-10-13 20:23:43 +03:00
guillep2k
d93d5d7906 Backport: Ignore mentions for users with no access (#8395) (#8484)
* Ignore mentions for users with no access

* Fix fmt
2019-10-13 16:17:53 +01:00
zeripath
5c3863c319 Restore functionality for early gits (#7775) (#8476)
* Change tests to make it possible to run TestGit with 1.7.2

* Make merge run on 1.7.2

* Fix tracking and staging branch name problem

* Ensure that git 1.7.2 works on tests

* ensure that there is no chance for conflicts

* Fix-up missing merge issues

* Final rm

* Ensure LFS filters run on the tests

* Do not sign commits from temp repo

* Apply suggestions from code review

* Update modules/repofiles/temp_repo.go
2019-10-13 12:40:13 +08:00
guillep2k
80b50afe1f Add check for empty set when dropping indexes during migration (#8475) 2019-10-12 06:31:12 +01:00
zeripath
20a28b785a
Ensure Request Body Readers are closed in LFS server (#8454) (#8459) 2019-10-11 17:11:06 +01:00
zeripath
d330b2f52b
Ensure that LFS files are relative to the LFS content path (#8455) (#8458) 2019-10-11 13:41:55 +01:00
6543
6ab1d5a8a0 Changelog for v1.9.4 (#8422)
* changelog

* Update CHANGELOG.md

We ned to revert this then ...

Co-Authored-By: Lauris BH <lauris@nix.lv>
2019-10-08 20:54:58 +03:00
Lauris BH
05f6566786 Revert "[Backport] Fix issues/pr list broken when there are man… (#8425)
This reverts commit 0ea4b786cb.
2019-10-08 18:12:41 +02:00
6543
0ea4b786cb [Backport] Fix issues/pr list broken when there are many repositories (#8409) (#8418)
* Fix issues/pr list broken when there are many repositories (#8409)

* fix issues/pr list broken when there are many repositories

* remove unused codes

* fix counting error on issues/prs

* keep the old logic

* fix panic

* fix tests

* rm unused import
2019-10-08 14:35:00 +03:00
6543
30718ce4ac fix bug when migrating a private repository (#7917) (#8403) 2019-10-07 00:58:35 -04:00
6543
aeec78543b Change general form binding to gogs form (#8334) (#8402) 2019-10-07 00:20:07 -04:00
6543
c9b8c12bc9 feat: highlight issue references with : (#8101) (#8404)
* feat: highlight issue references with :

e.g. #1287: my commit msg
e.g. ABC-1234: my commit msg

* ref: update model regex to consistent with issueNumericPattern

* test: check highlight issue with : in commits messages
2019-10-06 23:41:46 -04:00
6543
b0dcf417ea Fix milestone num_issues (#8221) (#8400)
* fix milestone num_issues

* update missing completeness

* only update milestone closed number when closed issue is assigned a new milestone or clear milestone

* fix tests

* fix update milestone num

* fix completeness calculate

* make completeness calucation more clear
2019-10-07 11:03:43 +08:00
6543
797194d2d0 Fix editor commit to new branch if PR disabled (#8375) (#8401) 2019-10-07 09:28:18 +08:00
guillep2k
5bac1a692a Allow users with explicit read access to give approvals (#8398) 2019-10-06 16:52:25 -04:00
6543
b6fba5b459 fix version-validation (because of 1.12 -> 1.13 switch) (#8389)
* fix depenedency

* make vendor first
2019-10-06 00:10:47 -04:00
Elias Norberg
e90d88d5d5 Backport of commit status fixes in PR #8316 and PR #8321 to v1.9 (#8339)
* Use correct index when fetching commit status

Signed-off-by: Elias Norberg <elias@aisle.se>

* Compare against base repo to avoid mismatch when merging from fork

Signed-off-by: Elias Norberg <elias@aisle.se>

* Fix pull request commit status in user dashboard list
2019-10-01 19:16:45 +02:00
David Svantesson
7156e2a71a Fix API for edit and delete release attachment (#8290)
* Add logging for when user requested attachment doesn't belong to the specified release.

* Fix API to use correct variable for release asset (attachment)
2019-09-26 21:16:47 +08:00
Daniel Fonseca de Lira
e51d91a258 Fix assets on release webhook (#8283) 2019-09-25 22:50:54 +03:00
Daniel Fonseca de Lira
0ed5a647dd Fix release API URL generation (#8239) 2019-09-19 11:15:19 -04:00
guillep2k
3fc42add16 Allow registration when button is hidden (#8238) 2019-09-19 11:58:47 +03:00
Bjoern Petri
4b9786ba62 MS Teams webhook misses commit messages (#8225)
The current webhook just shows the amount of commits, but misses the actual commit description. While the code is actually there to include the description, it is just not included.

Signed-off-by: Bjoern Petri <bjoern.petri@sundevil.de>
2019-09-18 11:51:13 +03:00
Mura Li
aaf975bff1 Fix data race (#8206)
* Fix data race

* Fix data race in modules/log

* Make the scope of lock finner-grained

* Use syc.Map

* Fix missing change in the test

* Do not export LoggerMap
2019-09-17 12:40:28 +03:00
Lunny Xiao
267fbbf201
Fix team user api (#8172) (#8188)
* fix team user api

* fix tests

* fix api

* fix team user api

* change user convert

* fix tests

* fix tests
2019-09-17 11:23:40 +08:00
Mura Li
9e8df4b838 Fix pull merge 500 error caused by git-fetch breaking behaviors (#8194) 2019-09-16 13:27:05 -04:00
Jakob Ackermann
d78aa189ec [ssh] fix the config specification in the authorized_keys template (#8031) (#8193)
The gitea flags must appear in front of the gitea command. Otherwise
 they are ignored.

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
(cherry picked from commit 89648746a5)
2019-09-16 09:41:30 +08:00
Filip Navara
6883c007d3 [backport/v1.9] Fix reading git notes from nested trees (#8189)
* Fix reading notes from nested trees

The GIT documentation for notes states "Permitted pathnames have the
form ab/cd/ef/.../abcdef...: a sequence of directory names of two
hexadecimal digits each followed by a filename with the rest of
the object ID."

* Add test case

* Fix new lines
2019-09-15 17:59:08 -04:00
jaqra
91ea086ebe [fix #7384] make show private icon when repo avatar set (#8144) (#8175) 2019-09-14 00:58:31 +03:00
guillep2k
b228d22736 Add reviewrs as participants (#8124) 2019-09-12 17:52:33 -04:00
Antoine GIRARD
c4d8d53a6d Backport: Use vendored go-swagger (#8087) (#8165)
* Use vendored go-swagger (#8087)

* Use vendored go-swagger

* vendor go-swagger

* revert un wanteed change

* remove un-needed GO111MODULE

* Update Makefile

Co-Authored-By: techknowlogick <matti@mdranta.net>

* re-generate swagger file
2019-09-12 22:58:09 +03:00