1920 Commits (08c63190c68ca63f99f510f7f2c6cda41d531343)

Author SHA1 Message Date
Lunny Xiao 2d0b90c967 Fix upload file type check (#7890)
* fix upload file type check

* make the function simple and added tests

* Update comment as per @silverwind
5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
Lunny Xiao c021890930
move CreateReview to moduels/pull (#7841) 5 years ago
zeripath def84840db Attempt to fix hook problem (#7854) 5 years ago
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>
5 years ago
Antoine GIRARD 46d6b92ad0 Import topics during migration (#7851)
* add GetTopics interface

* CreateTopics

* remove un-needed comment
5 years ago
Mura Li 602155df7b Do not fetch all refs (#7797)
Which would unnecessarily slow down the pull compare operation.
5 years ago
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.
5 years ago
Antoine GIRARD e9bb75d8d1 Fix duplicate call of webhook (#7821) 5 years ago
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
5 years ago
zeripath 7ad67109d7
Be more strict with git arguments (#7715)
* Be more strict with git arguments
* fix-up commit test
* use bindings for branch name
5 years ago
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
5 years ago
FlorianBen 0e887af2d1 Fix specific highlighting (CMakeLists.txt ...) (#7686)
* Fix specific highlighting.

* Highlighting CMakeLists.txt:
remove case sensitive checks.
use lowercase checks instead.
5 years ago
guillep2k 3566d2c860 Include "executable" files in the index, as they are not necessarily binary (#7718) 5 years ago
Lunny Xiao e503794371 remove unnecessary fmt on generate bindata (#7706) 5 years ago
zeripath a4b7a4f2f8 Correct wrong datetime format for git (#7689) 5 years ago
Lunny Xiao e7d4895732
Move commit repo action from models to repofiles package (#7645)
* move commit repo action from models to repofiles package

* fix unit tests
5 years ago
Lunny Xiao a94ae7acb0 fix bug on migrating milestone from github (#7665) 5 years ago
Lunny Xiao 6782a704ef Fix bug create/edit wiki pages when code master branch protected (#7580)
* fix bug create/edit wiki pages when code master branch protected

* improve FullPushingEnvironment function
5 years ago
zeripath 6485962dd5
Fix panic on push at #7611 (#7615)
* Fix panic in #7611

Use pr.IssueID instead of pr.Issue.ID as Issue may not be loaded and is unnecessary

* Only fetch the head branch from the remote
5 years ago
Lunny Xiao 2c5c458dd7
Move models.PushUpdate to repofiles.PushUpdate (#7485)
* move models.PushUpdate to repofiles.PushUpdate

* remove duplicated code to load repo
5 years ago
Christian Muehlhaeuser 5e4e7d3df0 Added missing error checks in tests (#7554)
Whenever we assign a value to err, check for it being nil.
5 years ago
Christian Muehlhaeuser 54d96c79b5 Removed unnecessary conversions (#7557)
No need to convert to the same type.
5 years ago
silverwind fe7689a6b2 Fix empty commits now showing in repo overview (#7521)
* Fix empty commits now showing in repo overview

* add test

* make fmt
5 years ago
Christian Muehlhaeuser 9a965035f0 Un-lambda base.FileSize (#7556)
No need to wrap this.
5 years ago
Lunny Xiao 8ad64574ee Fix markdown invoke sequence (#7513) 5 years ago
Lunny Xiao 8ea60e7e61
remove duplicated webhook trigger (#7511) 5 years ago
Lunny Xiao ce087c58ef
Remove settting dependency on modules/session (#7237)
* remove settting dependency on modules/session

* fix fmt

* fix tests

* fix lint
5 years ago
Lunny Xiao d2958d9f46 Move status table to cron package (#7370) 5 years ago
Lunny Xiao 2739a0be98
only create opened pull request when migrating from github (#7463) 5 years ago
Tamal Saha 2102f9d92d Support setting cookie domain (#6288)
Signed-off-by: Tamal Saha <tamal@appscode.com>
5 years ago
Cherrg a7b1ba0e3d wiki history improvements (#7391)
* add history comments to detect page delete

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* fix too much history entries
- caused by --follow flag
  - if files with same contents exists

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* style imprevements wiki
- history - wrap long author names

Signed-off-by: Michael Gnehr <michael@gnehr.de>
5 years ago
Lunny Xiao 427a161c67 Fix migration tests since #7 fixed (#7375)
* fix migration tests since #7 fixed

* fix test time
5 years ago
mrsdizzie 1f1ecda541 Display original author and URL information when showing migrated issues/comments (#7352)
* Store original author info for migrated issues and comments

Keep original author name for displaying in Gitea interface and also
store original author user ID for potential future use in linking
accounts from old location.

* Add original_url for repo

Store the original URL for a migrated repo

Clean up migrations/tests

* fix migration

* fix golangci-lint

* make 'make revive' happy also

* Modify templates to use OriginalAuthor if set

Use the original author name in templates if it is set rather than the
user who migrated/currently owns the issues

* formatting fixes

* make generate-swagger

* Use default avatar for imported comments

* Remove no longer used IgnoreIssueAuthor option

* Add OriginalAuthorID to swagger also
5 years ago
Mura Li f88aa1d215 Support git.PATH entry in app.ini (#6772) 5 years ago
EpicCoder 8d9d6aa903 Add additional password hash algorithms (closes #5859) (#6023) 5 years ago
Antoine GIRARD f369788347 Refactor filetype is not allowed errors (#7309) 5 years ago
techknowlogick d0ec940dd7
switch to use gliderlabs/ssh for builtin server (#7250)
resolves git conflicts from #3896 (credit to @belak, in case github doesn't keep original author during squash)

Co-Authored-By: Matti Ranta <techknowlogick@gitea.io>
5 years ago
mrsdizzie 7166629d9c Fix typo in PR migration check (#7368) 5 years ago
AJ ONeal 62d6127f1b Make captcha and password optional for external accounts (#6606) 5 years ago
Lunny Xiao 337d6915ff Detect migrating batch size (#7353)
* Make migrating batch size as configurable

* detect different table batch insert size and remove config item

* remove unrelated changes
5 years ago
Filip Navara 6e2a59e4ce Use commit graph files for listing pages (#7314)
* Experimental support for git commit graph files and bloom filter index

Signed-off-by: Filip Navara <filip.navara@gmail.com>

* Force vendor of commitgraph

Signed-off-by: Filip Navara <filip.navara@gmail.com>

* Remove bloom filter experiment and debug prints

* Remove old code for building commit graphs

* Remove unused function

* Remove mmap usage

* gofmt

* sort vendor/modules.txt

* Add copyright header and log commit-graph error
5 years ago
Lunny Xiao e728b55812 Fix bug conflict between SyncReleasesWithTags and InsertReleases (#7337)
* fix bug conflict between SyncReleasesWithTags and InsertReleases

* fix tests

* fix fmt
5 years ago
zeripath 3563650bdb #6946 Run hooks on merge/edit and cope with protected branches (#6961)
* Fix #6946 by checking PullRequest ID on pushing

* Ensure we have the owner name, the pr attributes and the the issue

* Fix TestSearchRepo by waiting till indexing is done

* Update integrations/repo_search_test.go

* changes as per @mrsdizzie

* missing comma

* Spelling mistake

* Fix full pushing environment
5 years ago
Lunny Xiao ff85dd3e12 Add commit statuses reports on pull request view (#6845)
* Add commit statuses reports on pull view

* Add some translations

* improve the UI

* fix fmt

* fix tests

* add a new test git repo to fix tests

* fix bug when headRepo or headBranch missing

* fix tests

* fix tests

* fix consistency

* fix tests

* fix tests

* change the test repo

* fix tests

* fix tests

* fix migration

* keep db size consistency

* fix translation

* change commit hash status table unique index

* remove unused table

* use char instead varchar

* make hashCommitStatusContext private

* split merge section with status check on pull view ui

* fix tests; fix arc-green theme on pull ui
5 years ago
Richard Mahn cd96dee982 Fixes #7292 - API File Contents bug (#7301) 5 years ago