Commit graph

7874 commits

Author SHA1 Message Date
Mura Li
a678ea44b8 Update MAINTAINERS (#7896) 2019-08-16 23:17:34 -04:00
GiteaBot
4bc4acd02b [skip ci] Updated translations via Crowdin 2019-08-16 22:53:51 +00:00
guillep2k
de5986ae03 Reduce quote usage to bypass bug in GIT_SSH_COMMAND (#7893) 2019-08-16 23:28:55 +01:00
zeripath
bee1227b2f
Extract the username and password from the mirror url (#7651)
* Explode out mirror username and password

* Update models/repo_mirror.go

* Just roundtrip the password

* remove unused declaration

* Update templates/repo/settings/options.tmpl
2019-08-16 22:56:57 +01:00
Norwin
867f46f78e Detect delimiter in CSV rendering (#7869)
* detect csv delimiter in csv rendering

fixes #7868

* make linter happy

* fix failing testcase & use ints where possible

* expose markup type to template

previously all markup had the .markdown class, which is incorrect,
as it applies markdown CSS & JS logic to CSV rendering

* fix build (missing `make css`)

* ignore quoted csv content for delimiter scoring

also fix html generation
2019-08-16 01:09:50 +03:00
guillep2k
0a86d25e6a Add myself to maintainers (#7881)
* Add myself to maintainers

* Add missing handle

Co-Authored-By: techknowlogick <matti@mdranta.net>
2019-08-15 13:23:57 -04:00
guillep2k
5661773018 Remove unique filter from repo indexer analyzer. (#7878)
* Remove unique filter from repo indexer analyzer.

* Bump repoIndexerLatestVersion to 4

* Corrrect fmt

* make vendor to remove unique dependency
2019-08-15 23:38:55 +08:00
Lunny Xiao
85202d4784
Display ui time with customize time location (#7792)
* display ui time with customize time location

* fix lint

* rename UILocation to DefaultUILocation

* move time related functions to modules/timeutil

* fix tests

* fix tests

* fix build

* fix swagger
2019-08-15 22:46:21 +08:00
guillep2k
5a44be627c Convert files to utf-8 for indexing (#7814)
* Convert files to utf-8 for indexing

* Move utf8 functions to modules/base

* Bump repoIndexerLatestVersion to 3

* Add tests for base/encoding.go

* Changes to pass gosimple

* Move UTF8 funcs into new modules/charset package
2019-08-15 20:07:28 +08:00
Antoine GIRARD
c2c35d169c lfs/lock: round locked_at timestamp to second (#7872)
* lfs/lock: round locked_at timestamp to second

* test returned locked_at values

* tests: use time RFC3339
2019-08-15 18:53:28 +08:00
Lunny Xiao
a077c9d551
Add changelog of v1.9.1 (#7859) (#7866)
* add changelog of v1.9.1

* Update CHANGELOG.md

Co-Authored-By: Lauris BH <lauris@nix.lv>

* mention releases build by go1.12.8

* Update CHANGELOG.md

Co-Authored-By: Lauris BH <lauris@nix.lv>
2019-08-15 10:45:21 +08:00
Lanre Adelowo
a315c8d992 fix non existent milestone with 500 error (#7867) 2019-08-14 19:43:50 -04:00
GiteaBot
14230ca843 [skip ci] Updated translations via Crowdin 2019-08-14 15:35:51 +00:00
Lunny Xiao
c021890930
move CreateReview to moduels/pull (#7841) 2019-08-14 23:32:19 +08:00
GiteaBot
eaa4d4ea98 [skip ci] Updated translations via Crowdin 2019-08-14 11:34:49 +00:00
zeripath
176ba79e96
Fix local runs of ssh-requiring integration tests (#7855) 2019-08-14 12:19:13 +01:00
GiteaBot
cbe30783c7 [skip ci] Updated translations via Crowdin 2019-08-14 09:39:51 +00:00
zeripath
def84840db Attempt to fix hook problem (#7854) 2019-08-14 12:25:05 +03:00
Gary Kim
7eed11e5e9 Check commit message hashes before making links (#7713)
* Check commit message hashes before making links

Previously, when formatting commit messages, anything
that looked like SHA1 hashes was turned into a link
using regex. This meant that certain phrases or numbers
such as `777777` or `deadbeef` could be recognized as a commit
even if the repository has no commit with those hashes.

This change will make it so that anything that looks
like a SHA1 hash using regex will then also be checked
to ensure that there is a commit in the repository
with that hash before making a link.

Signed-off-by: Gary Kim <gary@garykim.dev>

* Use gogit to check if commit exists

This commit modifies the commit hash check
in the render for commit messages to use
gogit for better performance.

Signed-off-by: Gary Kim <gary@garykim.dev>

* Make code cleaner

Signed-off-by: Gary Kim <gary@garykim.dev>

* Use rev-parse to check if commit exists

Signed-off-by: Gary Kim <gary@garykim.dev>

* Add and modify tests for checking hashes in html link rendering

Signed-off-by: Gary Kim <gary@garykim.dev>

* Return error in sha1CurrentPatternProcessor

Co-Authored-By: mrsdizzie <info@mrsdizzie.com>

* Import Gitea log module

Signed-off-by: Gary Kim <gary@garykim.dev>

* Revert "Return error in sha1CurrentPatternProcessor"

This reverts commit 28f561cac46ef7e51aa26aefcbe9aca4671366a6.

Signed-off-by: Gary Kim <gary@garykim.dev>

* Add debug logging to sha1CurrentPatternProcessor

This will log errors by the git command run in
sha1CurrentPatternProcessor if the error is one
that was unexpected.

Signed-off-by: Gary Kim <gary@garykim.dev>
2019-08-14 16:04:55 +08:00
Antoine GIRARD
46d6b92ad0 Import topics during migration (#7851)
* add GetTopics interface

* CreateTopics

* remove un-needed comment
2019-08-14 14:16:12 +08:00
techknowlogick
99a004c343
Update golangci-lint to v1.17.1 (#7848) 2019-08-13 23:32:38 -04:00
clavinet
2f2a4cb898 Update app.ini.sample (#7816)
grammar fix
2019-08-13 23:28:11 -04:00
Antoine GIRARD
7ffa3fcfa0 gpg/bugfix: Use .ExpiredUnix.IsZero to display green color of forever valid gpg key (#7846)
* Use .ExpiredUnix.IsZero for display green color of gpg key

* remove useless parentheses
2019-08-14 09:39:44 +08:00
GiteaBot
0b2d399b1c [skip ci] Updated translations via Crowdin 2019-08-13 17:11:27 +00:00
Antoine GIRARD
26a78fa6b3 vendor: update pdf.js to v2.1.266 (#7834) 2019-08-13 20:09:06 +03:00
Mura Li
602155df7b Do not fetch all refs (#7797)
Which would unnecessarily slow down the pull compare operation.
2019-08-13 11:30:44 +03:00
GiteaBot
c662f4ced8 [skip ci] Updated translations via Crowdin 2019-08-12 21:54:26 +00:00
Antoine GIRARD
9692ebcc54 add details for db socket listening (#7830) 2019-08-12 17:52:11 -04:00
WGH
98fd085039 Fix lax comparison in validation tests (#7815)
If you add t.Logf("%+v %+v", actual, testCase.expectedErrors) to
the test code, you'll notice that only Errors' Messages are being
compared:

    --- PASS: Test_ValidURLValidation/Invalid_schema (0.00s)
    binding_test.go:43: [Url] [Url]

FieldNames and Classification are ignored in comparison.

Moreover, an Errors slice with a single Error with empty message
is formatted as '[]' (the same as empty slice), which is also
error-prone. I discovered this when working on #7791 when one test which
was not supposed to pass did pass. https://play.golang.org/p/qC4wVLrm4NG

This commit changes the test to do the comparison properly.
2019-08-12 10:17:25 +08:00
Antoine GIRARD
e9bb75d8d1 Fix duplicate call of webhook (#7821) 2019-08-11 23:31:18 +03:00
Mario Lubenka
8bfeb85f93 Enable switching to a different source branch when PR already exists (#7819)
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
2019-08-11 23:23:49 +08:00
clavinet
8101d803e6 Update serv.go (#7822)
small semantics fix
"Hi there, user!" looks better than "Hi there: user!"
2019-08-11 20:15:58 +08:00
clavinet
80d2c2575b Update app.ini.sample (#7817)
small grammar fix
2019-08-10 15:25:26 -04:00
David Svantesson
cde95f9923 Rewrite existing repo units if setting is not included in api body (#7763)
* Rewrite existing repo units if setting is not included in api body

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* else-if on one row
2019-08-10 12:32:46 +03:00
Gary Kim
2ed21e7e09 Prevent Commit Status and Message From Overflowing On Branch Page (#7800)
* Prevent Commit Status From Overflowing On Branch Page

It is possible for the commit ci status
on the branches page for a repository to
become an ellipsis due to overflowing.

This commit will fix that issue by
using flex.

Signed-off-by: Gary Kim <gary@garykim.dev>

* Fix multiple overflowing issues in commits table

It was possible that the commit message would
overflow hiding the expand commits button
and commit status. This change ensures that
the correct elements overflow without hiding
anything else.

This change also reverts using flex in the
commits list because it was causing issues
in Blink based browsers.

Signed-off-by: Gary Kim <gary@garykim.dev>

* Remove unnecessary html element and fix indentation issues
2019-08-09 20:57:29 +08:00
Antoine GIRARD
2b6f45299d api: fix multiple bugs with statuses endpoints (#7785)
* fix commit statuses api url

* search refs before passing sha

* adjust tests

* directly search tags and branches names + remove un-needed check in NewCommitStatus

* fix comment

* de-duplicate code

* test: use relative setting.AppURL

* Update routers/api/v1/repo/status.go

Co-Authored-By: Lauris BH <lauris@nix.lv>

* remove return

* Update routers/api/v1/repo/status.go

Co-Authored-By: Lauris BH <lauris@nix.lv>
2019-08-09 10:13:03 +08:00
Mason
c534b7e211 Add SSH_LISTEN_HOST to the config cheatsheet (#7793)
This was missing before, and this commit adds it with the correct
default value and description
2019-08-08 18:40:31 +03:00
silverwind
a21a7d438b Fix global search result CSS, misc CSS tweaks (#7789)
- Fixes double line-numbers and padding in Explore > Code > Search
- Moved code-view specific CSS out of their parents to share those
styles better.
- Fix misc issues discovered in code,diff and blame view, especially for
the dark theme.
2019-08-08 22:46:03 +08:00
Antoine GIRARD
e54814dcaa activate sum.golang.org check (#7782) 2019-08-08 12:38:23 +03:00
guillep2k
3b97b9efbf Correct formatting of bullet list (#7794) 2019-08-08 07:47:57 +03:00
Lunny Xiao
b16be15803 Display error as string but not bytes (#7780)
* display error as string but not bytes

* Update routers/repo/http.go

Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com>
2019-08-07 19:33:29 +03:00
Lars Kistner
714dcf9dad remove -i flag from GOFLAGS (#7778)
this flag is not needed for Go versions >=1.10 and creates problems
while building. see https://github.com/golang/go/issues/27285#issuecomment-424382413
2019-08-07 17:05:18 +08:00
Lunny Xiao
c832f0eef7 Fix approvals counting (#7757)
* fix approvals counting

* fix tests

* fmt
2019-08-07 07:22:41 +03:00
WGH
28c5ae27d6 Fix Slack webhook fork message (#7774)
The order of forkee and fork was mixed up.
2019-08-06 19:27:10 -04:00
guillep2k
0470b16e8a Add migration step to remove old repo_indexer_status orphaned records (#7746)
* Add migration step to remove old repo_indexer_status orphaned records

* Include RepoIndexerStatus struct definition in the migrate function

* Change .Delete(o) into ID(o.ID).Delete(new(RepoIndexerStatus))

* Simplification of the delete procedure

* Rename v91.go to v92.go
2019-08-06 11:57:55 +03:00
Lunny Xiao
4328d8e8d7
fix rename failed when rewrite public keys (#7761) 2019-08-06 14:32:11 +08:00
guillep2k
2594693a46 Remove camel case tokenization from repo indexer (#7733)
* Make repository indexer tokenize by camel case selectable

* Revert "Make repository indexer tokenize by camel case selectable"

This reverts commit a8d4e40af56ffeab9c040a13e01b9e0d5487bd3b.

* Remove app.ini setting, permanently remove camel case tokenizer

* Increase repoIndexerLatestVersion to force indexes to be rebuilt

* Changes introduced by the commmand make vendor
2019-08-06 07:38:16 +03:00
zeripath
026696b87a
Fix dropTableColumns sqlite implementation (#7710)
* Fix dropTableColumns sqlite implementation

* use droptables and its index dropping support in v78 and v85

* golang-ci fixes

* Add migration from gitea 1.3.3 for sqlite which reveals the droptables bug - thus showing this works
2019-08-05 22:49:49 +01:00
zeripath
7ad67109d7
Be more strict with git arguments (#7715)
* Be more strict with git arguments
* fix-up commit test
* use bindings for branch name
2019-08-05 21:39:39 +01:00
silverwind
1d8915ad5d Add a lot of extension to language mappings for syntax highlights (#7741)
Data partially based on [CodeMirror's meta.js](https://github.com/codemirror/CodeMirror/blob/master/mode/meta.js).

Fixes: https://github.com/go-gitea/gitea/issues/6057
2019-08-05 23:48:31 +08:00