aboutsummaryrefslogtreecommitdiffstats
path: root/models
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug conflict between SyncReleasesWithTags and InsertReleases (#7337)Lunny Xiao2019-07-012-13/+15
| | | | | | | | * fix bug conflict between SyncReleasesWithTags and InsertReleases * fix tests * fix fmt
* make dropTableColumns drop columns on sqlite and constraints on all (#6849)zeripath2019-07-011-2/+90
|
* #6946 Run hooks on merge/edit and cope with protected branches (#6961)zeripath2019-07-013-8/+18
| | | | | | | | | | | | | | | | | | * 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
* Add commit statuses reports on pull request view (#6845)Lunny Xiao2019-06-308-74/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Use batch insert on migrating repository to make the process faster (#7050)Lunny Xiao2019-06-291-51/+80
| | | | | | | | | | * Use batch insert on migrating repository to make the process faster * fix lint * fix tests * fix comments
* Show Pull Request button or status of latest PR in branch list (#6990)Mario Lubenka2019-06-271-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Show Pull Request button or status of latest PR in branch list Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Do not show pull request button on deleted branches Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Do not show commit divergence on deleted branches Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use XORMs Get instead of limit * Links pull request ID and use smaller labels for displaying the pull request status Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Handle error when getting latest pull request Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Indent template Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Check error when loading issue Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* fix extra newlines when copying from diff in Firefox (#7288)silverwind2019-06-261-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix extra newlines when copying from diff See https://bugzilla.mozilla.org/show_bug.cgi?id=1273836 Basically, the <pre><code> seems to add a forced newline that is not possible to get rid of via CSS, so I replaced it with just a <code>. Secondly, .lines-type-marker also forced a newline in the copied text, but that was possible to get rid of via user-select. Safari still has a extraneous newline in the copied text of unknown origin, but this should not block stop this PR. * simplify .line-type-marker * fix selector * remove erronous ^^^ * Fix empty split diff * Fix arc-theme-green * fix add comment * ensure line-num is copied too * Update templates/repo/diff/box.tmpl Co-Authored-By: zeripath <art27@cantab.net> * attempt to fix safari via removing <code> * remove useless whitespace at the end of 'class' * remove inter-tag whitespace for code <td>s * more inter-tag removal * final inter-tag removal * attempt to fix empty line copy * move and comment getLineContent * fix golint * make background grey for missing added code
* Monitor all git commands; move blame to git package and replace git as a ↵Lunny Xiao2019-06-268-303/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | variable (#6864) * monitor all git commands; move blame to git package and replace git as a variable * use git command but not other commands * fix build * move exec.Command to git.NewCommand * fix fmt * remove unrelated changes * remove unrelated changes * refactor IsEmpty and add tests * fix tests * fix tests * fix tests * fix tests * remove gitLogger * fix fmt * fix isEmpty * fix lint * fix tests
* Make diff line-marker non-selectable (#7279)zeripath2019-06-242-15/+18
| | | | | | | | * Make diff line-marker non-selectable * Move to use data-* as per @mrsdizzie * fix missing line nums * Add a minimum-width to force right-align of the line num * Move line-type-marker into separate column
* Fix error log when loading issues caused by a xorm bug (#7271)Lunny Xiao2019-06-2325-76/+53
| | | | | | | | | | | | * fix error log when loading issues caused by a xorm bug * upgrade packages * fix fmt * fix Consistency * fix tests
* Fix #732: Add LFS objects to base repository on merging (#7082)zeripath2019-06-221-285/+3
| | | | On merge we walk the merge history and ensure that all lfs objects pointed to in the history are added to the base repository. This switches from relying on having git-lfs installed on the server, (and in fact .gitattributes being correctly installed.)
* Add missing description of label on API (#7159)Lunny Xiao2019-06-161-3/+4
| | | | | | | | * add missing description of label on API * fix comment head * fix swagger
* Use go method to calculate ssh key fingerprint (#7128)Antoine GIRARD2019-06-162-21/+92
| | | | | | | | | | | | * Use go method to calculate key fingerprint * add gitea copyright * use native go method only for built-in server * refactor and add tests * add gitea copyright
* Add LastLogin to the User API (#7196)zeripath2019-06-151-0/+2
|
* Only warn on errors in deleting LFS orphaned files during repo deletion (#7213)zeripath2019-06-152-5/+2
|
* fix duplicated file on pull request conflicted files (#7211)Lunny Xiao2019-06-151-1/+11
|
* Allow colon between fixing word and issue (#7207)zeripath2019-06-152-1/+27
| | | | | | * Allow colon between fixing word and issue * update test
* Add error for fork already existing (#7185)John Olheiser2019-06-123-4/+22
|
* Add golangci (#6418)kolaente2019-06-1243-251/+350
|
* Fix database lock when use random repository fallback image (#7166)Lunny Xiao2019-06-111-11/+10
| | | | | | * fix database lock when use random repository fallback image * remove unused function
* Fixes diff on merged pull requests (#7171)Mario Lubenka2019-06-111-1/+1
|
* Various fixes for issue mail notifications (#7165)silverwind2019-06-112-16/+38
| | | | | | | | | - Send individual mails for actions and comments - Send mail for new issues/prs without a comment - Use correct sender for reopen/close actions - Hopefully fixed all bugs related to missing mails Fixes: https://github.com/go-gitea/gitea/issues/7124 Fixes: https://github.com/go-gitea/gitea/issues/5977
* Move PushUpdate dependency from models to repofiles (#6763)Lunny Xiao2019-06-101-4/+0
| | | | | | * remove push_update * move models.PushUpdate to repofiles.PushUpdate
* Fixes #2738 - Adds the /git/tags API endpoint (#7138)Richard Mahn2019-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fixes #2738 - /git/tags API * proper URLs * Adds function comments * Updates swagger * Removes newline from tag message * Removes trailing newline from commit message * Adds integration test * Removed debugging * Adds tests * Fixes bug where multiple tags of same commit show wrong tag name * Fix formatting * Removes unused varaible * Fix to annotated tag function names and response * Update modules/git/repo_tag.go Co-Authored-By: Lauris BH <lauris@nix.lv> * Uses TagPrefix * Changes per review, better error handling for getting tag and commit IDs * Fix to getting commit ID * Fix to getting commit ID * Fix to getting commit ID * Fix to getting commit ID
* Add command to convert mysql database from utf8 to utf8mb4 (#7144)Lunny Xiao2019-06-081-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add command to convert mysql database from utf8 to utf8mb4 * Update cmd/convert.go Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com> * Update cmd/convert.go Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com> * Update cmd/convert.go Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com> * Update models/convert.go Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com> * Update models/convert.go Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com> * Update cmd/convert.go Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com> * Update cmd/convert.go Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com>
* Compare branches, commits and tags with each other (#6991)Mario Lubenka2019-06-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Supports tags when comparing commits or branches Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Hide headline when only comparing and don't load unused data Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Merges compare logics to allow comparing branches, commits and tags with eachother Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Display branch or tag instead of commit when used for comparing Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show pull request form after click on button Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Transfers relevant pull.go changes from master to compare.go Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Fixes error when comparing forks against a commit or tag Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes console.log from JavaScript file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show icon next to commit reference when comparing branch or tag Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Updates css file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Fixes import order * Renames template variable * Update routers/repo/compare.go Co-Authored-By: zeripath <art27@cantab.net> * Update from master Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Allow short-shas in compare * Renames prInfo to compareInfo Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Check PR permissions only if compare is pull request Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adjusts comment Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use compareInfo instead of prInfo
* Detect noreply email address as user (#7133)zeripath2019-06-061-0/+13
|
* Add state param to milestone listing API (#7131)Lanre Adelowo2019-06-064-13/+61
| | | | | | | | | | | | | | | | * Support state params * update tests * fix tests * add state=all support * update tests * update swagger * update swagger
* Repository avatar fallback configuration (#7087)Mario Lubenka2019-06-021-8/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Only show repository avatar in list when one was selected Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds fallback configuration option for repository avatar Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Implements repository avatar fallback Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds admin task for deleting generated repository avatars Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Solve linting issues Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Save avatar before updating database * Linting * Update models/repo.go Co-Authored-By: zeripath <art27@cantab.net>
* Move serv hook functionality & drop GitLogger (#6993)zeripath2019-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move hook functionality internally * Internalise serv logic * Remove old internal paths * finally remove the gitlogger * Disallow push on archived repositories * fix lint error * Update modules/private/key.go * Update routers/private/hook.go * Update routers/private/hook.go * Update routers/private/hook.go * Updated routers/private/serv.go * Fix LFS Locks over SSH * rev-list needs to be run by the hook process * fixup * Improve git test * Ensure that the lfs files are created with a different prefix * Reduce the replication in git_test.go * slight refactor * Remove unnecessary "/" * Restore ensureAnonymousClone * Restore ensureAnonymousClone * Run rev-list on server side * Try passing in the alternative directories instead * Mark test as skipped * Improve git test * Ensure that the lfs files are created with a different prefix * Reduce the replication in git_test.go * Remove unnecessary "/"
* Fixes #5960 - Adds API Endpoint for Repo Edit (#7006)Richard Mahn2019-05-303-38/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Feature - #5960 - API Endpoint for Repo Editing * Revert from merge * Adds integration testing * Updates to integration tests * Revert changes * Update year in file header * Misspell fix * XORM = test * XORM = test * revert XORM = file * Makes RepoUnit.ID be pk and autoincr * Fix to units * revert header * Remove print statement * Adds other responses * Improves swagger for creating repo * Fixes import order * Better Unit Type does not exist error * Adds editable repo properties to the response repo structure * Fix to api_repo_edit_test.go * Fixes repo test * Changes per review * Fixes typo and standardizes comments in the EditRepoOption struct for swagger * Fixes typo and standardizes comments in the EditRepoOption struct for swagger * Actually can unarchive through the API * Unlike delete, user doesn't have to be the owner of the org, just admin to the repo * Fix to swagger comments for field name change * Update to swagger docs * Update swagger * Changes allow_pull_requests to has_pull_requests
* Repository avatars (#6986)Sergey Dryabzhinsky2019-05-294-0/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Repository avatars - first variant of code from old work for gogs - add migration 87 - add new option in app.ini - add en-US locale string - add new class in repository.less * Add changed index.css, remove unused template name * Update en-us doc about configuration options * Add comments to new functions, add new option to docker app.ini * Add comment for lint * Remove variable, not needed * Fix formatting * Update swagger api template * Check if avatar exists * Fix avatar link/path checks * Typo * TEXT column can't have a default value * Fixes: - remove old avatar file on upload - use ID in name of avatar file - users may upload same files - add simple tests * Fix fmt check * Generate PNG instead of "static" GIF * More informative comment * Fix error message * Update avatar upload checks: - add file size check - add new option - update config docs - add new string to en-us locale * Fixes: - use FileHEader field for check file size - add new test - upload big image * Fix formatting * Update comments * Update log message * Removed wrong style - not needed * Use Sync2 to migrate * Update repos list view - bigger avatar - fix html blocks alignment * A little adjust avatar size * Use small icons for explore/repo list * Use new cool avatar preparation func by @lafriks * Missing changes for new function * Remove unused import, move imports * Missed new option definition in app.ini Add file size check in user/profile avatar upload * Use smaller field length for Avatar * Use session to update repo DB data, update DeleteAvatar - use session too * Fix err variable definition * As suggested @lafriks - return as soon as possible, code readability
* Handle early git version's lack of get-url (#7065)zeripath2019-05-291-1/+12
|
* refactor: append, build variable and type switch (#4940)Bo-Yi Wu2019-05-283-10/+7
| | | | | | * refactor: append, build variable and type switch * fix: remove redundant space.
* chore: change issue mail title. (#7064)Bo-Yi Wu2019-05-281-1/+1
| | | | | | | | | | * chore: change issue mail title. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * change to fullname method Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* fix possbile mysql invalid connnection error (#7051)Lunny Xiao2019-05-261-0/+6
|
* Improve handling of non-square avatars (#7025)Rob Watson2019-05-251-19/+3
| | | | | | | | | | * Crop avatar before resizing (#1268) Signed-off-by: Rob Watson <rfwatson@users.noreply.github.com> * Fix spelling error Signed-off-by: Rob Watson <rfwatson@users.noreply.github.com>
* Fix default for allowing new organization creation for new users (#7017)jpicht2019-05-242-2/+3
| | | | | | | | | | | | Fixed #6542 When creating users DefaultAllowCreateOrganization was ignored. Signed-off-by: Julian Picht <julian.picht@gmail.com> * fix TestCreateUser_Issue5882 Signed-off-by: Julian Picht <julian.picht@gmail.com>
* Add support of utf8mb4 for mysql (#6992)Lunny Xiao2019-05-241-4/+5
|
* Change UpdateRepoIndex api to include watchers (#7012)zeripath2019-05-231-8/+13
| | | | | | * Change UpdateRepoIndex api to include watchers * Add timeout
* Make webhook http connections resuable (#6976)Lunny Xiao2019-05-211-26/+72
| | | | | | | | * make http connections resuable * add error handler * fix lint
* fix u2f registrationlist ToRegistrations() method (#6980)David Schneiderbauer2019-05-181-1/+1
|
* Fix index produces problem when issues/pulls deleted (#6973)Lunny Xiao2019-05-182-8/+28
| | | | | | | | | | * fix index produces problem when issues/pulls deleted * fix tests * fix tests * fix tests
* Stop running hooks on pr merge (#6963)zeripath2019-05-171-1/+2
| | | | | | * Stop running hooks on pr merge * Remove SSH_ORIGINAL_COMMAND from the pushing environment
* Allow collaborators to view repo owned private org (#6965)mrsdizzie2019-05-162-4/+18
| | | | | | | Handle case where an orginization is private but a user who is not a member of the orgninization has been added as a collaborator of a repo within that org Fixes #6962
* SearchRepositoryByName improvements and unification (#6897)zeripath2019-05-152-66/+74
|
* Webhook Logs show proper HTTP Method, and allow change HTTP method in form ↵techknowlogick2019-05-151-10/+15
| | | | | | | | | | | (#6953) * Fix #6951 - logs show proper HTTP Method, and allow change HTTP method in form * enforce POST method for webhook * set default if method is empty
* Refactor models.NewRepoContext to extract git related codes to modules/git ↵Lunny Xiao2019-05-151-44/+3
| | | | | | | | | | (#6941) * refactor models.NewRepoContext to extract git related codes to modules/git * fix imports * refactor
* Add work path CLI option (#6922)zeripath2019-05-141-1/+1
| | | | | Makes it possible to set the work path as a CLI option instead of relying on environment variables which are somewhat opaque
* Remove macaron dependent on models (#6940)Lunny Xiao2019-05-142-3/+7
|