summaryrefslogtreecommitdiffstats
path: root/modules/repofiles
Commit message (Collapse)AuthorAgeFilesLines
* Move PushUpdateAddDeleteTags to repository module from models (#10106)Lunny Xiao2020-02-031-1/+1
| | | | | | * Move PushUpdateAddDeleteTags to repository module from models * Fix deadlock on sqlite
* Improve push update options (#10105)Lunny Xiao2020-02-023-143/+187
| | | | | | | | | | | | | | * Improve push update options * fix test * More refactor and fix lint * fix lint * Fix lint Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix pull view when head repository or head branch missed and close related ↵Lunny Xiao2020-01-251-5/+17
| | | | | | | | | | | | | | | | | | pull requests when delete head repository or head branch (#9927) * fix pull view when head repository or head branch missed and close related pull requests when delete branch * fix pull view broken when head repository deleted * close pull requests when head repositories deleted * Add tests for broken pull request head repository or branch * fix typo * ignore special error when close pull request Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix wrong permissions check when issues/prs shared operations (#9885)Lunny Xiao2020-01-201-2/+2
| | | | | | | | | | | * Fix wrong permissions check when issues/prs shared operations * move redirect to the last of the function * fix swagger Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Give the stdout on temp_repo error (#9871)zeripath2020-01-201-3/+3
| | | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add require signed commit for protected branch (#9708)zeripath2020-01-153-7/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add require signed commit for protected branch * Fix fmt * Make editor show if they will be signed * bugfix * Add basic merge check and better information for CRUD * linting comment * Add descriptors to merge signing * Slight refactor * Slight improvement to appearances * Handle Merge API * manage CRUD API * Move error to error.go * Remove fix to delete.go * prep for merge * need to tolerate \r\n in message * check protected branch before trying to load it * Apply suggestions from code review Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * fix commit-reader Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Fix #9752 (#9769)zeripath2020-01-141-1/+1
|
* Move newbranch to standalone package (#9627)Lunny Xiao2020-01-142-10/+11
| | | | | | | | | | | | * Move newbranch to standalone package * move branch functions to modules to avoid dependencies cycles * fix tests * fix lint * fix lint
* Move create/fork repository from models to modules/repository (#9489)Lunny Xiao2020-01-121-2/+2
| | | | | | | | | | | | | | | | | | | | * Move create/fork repository from models to modules/repository * fix wrong reference * fix test * fix test * fix lint * Fix DBContext * remove duplicated TestMain * fix lint * fix conflicts
* Don't attempt to close issue if already closed (#9696)guillep2k2020-01-111-3/+5
| | | | Co-authored-by: Lauris BH <lauris@nix.lv>
* Move push commits from models to modules/repository (#9370)Lunny Xiao2020-01-103-20/+23
| | | | | | | | | | | | | | | | * Move push commits from models to modules/repository * fix test * fix test * fix test * fix test * fix test Co-authored-by: zeripath <art27@cantab.net>
* Mark PR reviews as stale at push and allow to dismiss stale approvals (#9532)David Svantesson2020-01-091-2/+2
| | | | | | | Fix #5997. If a push causes the patch/diff of a PR towards target branch to change, all existing reviews for the PR will be set and shown as stale. New branch protection option to dismiss stale approvals are added. To show that a review is not based on the latest PR changes, an hourglass is shown
* Fix deleted branch isn't removed when push the branch again (#9516)Lunny Xiao2019-12-271-0/+6
|
* Batch hook pre- and post-receive calls (#8602)zeripath2019-12-263-114/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * make notifyWatchers work on multiple actions * more efficient multiple notifyWatchers * Make CommitRepoAction take advantage of multiple actions * Batch post and pre-receive results * Set batch to 30 * Auto adjust timeout & add logging * adjust processing message * Add some messages to pre-receive * Make any non-200 status code from pre-receive an error * Add missing hookPrintResults * Remove shortcut for single action * mistaken merge fix * oops * Move master branch to the front * If repo was empty and the master branch is pushed ensure that that is set as the default branch * fixup * fixup * Missed HookOptions in setdefaultbranch * Batch PushUpdateAddTag and PushUpdateDelTag Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [API] Extend contents with dates (#9464)65432019-12-243-5/+28
| | | | | | | | | | | | | | | * extend CommitTree func * make sure Date NOT nil * spell corection Co-Authored-By: zeripath <art27@cantab.net> * add TEST Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* fixed bug in GitTreeBySHA where pulling items from a page other than page 1 ↵Brad Albright2019-12-221-5/+5
| | | | would fail because the wrong var was used to set the entries to return (#9459)
* Refactor comment (#9330)Lunny Xiao2019-12-151-2/+5
| | | | | | | | * Refactor comment * fix test * improve code
* File Edit: Author/Committer interchanged [BugFix] (#9297)65432019-12-093-3/+3
| | | | | | | | | * simple fix * fix test too * repair more twists use same sequence: first Author, then Commiter
* Move code indexer related code to a new package (#9191)Lunny Xiao2019-12-081-4/+0
| | | | | | | | | | | | * move code indexer related code to a new package * fix lint * fix tests * fix fmt * GetMaxID support interface parameter
* Move UpdateIssuesCommit from models to repofiles (#9276)Lunny Xiao2019-12-072-1/+333
|
* Move PushUpdateOptions from models to repofiles (#9124)Lunny Xiao2019-11-291-1/+12
|
* Expand/Collapse Files and Blob Excerpt while Reviewing/Comparing code (#8924)Benno2019-11-151-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * update #8659 fold/unfold code diffs * add fold button style * update #8659 implement expand up/down codes (blob excerpt) * fix golint errors * fix expand direction * remove debug message * update css style for blob exceprt * fix typo in comment * update style sheet with less * update expect diff (add SectionInfo) * update #8942 accept suggested change (fix typo) * close reader and check file type before get tail section * adjust button position and check file type before insert fold button * move index js to web_src * merge index.js with master * generate index.js * update js coding style
* Add Close() method to gogitRepository (#8901)zeripath2019-11-1312-0/+33
| | | | | | | | | In investigating #7947 it has become clear that the storage component of go-git repositories needs closing. This PR adds this Close function and adds the Close functions as necessary. In TransferOwnership the ctx.Repo.GitRepo is closed if it is open to help prevent the risk of multiple open files. Fixes #7947
* Migrate temp_repo.go to use git.NewCommand (#8918)zeripath2019-11-111-163/+82
| | | | | | | This PR migrates temp_repo.go to use git.NewCommand instead creating processes by itself - this fixes the problem underlying PR #8905. There are other places that run git outside of the controlled locale defined in #8548 but temp_repo.go is the only cause of failure of local testing in cases where English is not the default - implying that error messages from those other commands are not interpreted. Replaces #8905
* Auto-subscribe user to repository when they commit/tag to it (#7657)guillep2k2019-11-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add support for AUTO_WATCH_ON_CHANGES and AUTO_WATCH_ON_CLONE * Update models/repo_watch.go Co-Authored-By: Lauris BH <lauris@nix.lv> * Round up changes suggested by lafriks * Added changes suggested from automated tests * Updated deleteUser to take RepoWatchModeDont into account, corrected inverted DefaultWatchOnClone and DefaultWatchOnChanges behaviour, updated and added tests. * Reinsert import "github.com/Unknwon/com" on http.go * Add migration for new column `watch`.`mode` * Remove serv code * Remove WATCH_ON_CLONE; use hooks, add integrations * Renamed watch_test.go to repo_watch_test.go * Correct fmt * Add missing EOL * Correct name of test function * Reword cheat and ini descriptions * Add update to migration to ensure column value * Clarify comment Co-Authored-By: zeripath <art27@cantab.net> * Simplify if condition
* Move repofiles webhooks to notification (#8807)Lunny Xiao2019-11-061-67/+7
|
* Move push commits events to notification (#8783)Lunny Xiao2019-11-031-16/+2
| | | | | | | | * Move push commits events to notification * Update modules/notification/base/null.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Prevent upload (overwrite) of lfs locked file (#8769)David Svantesson2019-11-021-7/+17
| | | | | | | | | | | | * Check if file is locked on upload file commit. * Better user message if file is locked. * Check lfs lock before creating temporary repository. fix some errors. * move lines * Add comment that enabled setting is checked.
* Rename HookQueue to hookQueue (#8778)Lunny Xiao2019-11-021-4/+0
| | | | | | * Rename HookQueue to hookQueue * fix lint
* Move webhook to a standalone package under modules (#8747)Lunny Xiao2019-11-011-6/+7
| | | | | | | | * Move webhook to a standalone package under modules * fix test * fix comments
* Add basic repository lfs management (#7199)zeripath2019-10-282-2/+2
| | | | | | | | | | | | This PR adds basic repository LFS management UI including the ability to find all possible pointers within the repository. Locks are not managed at present but would be addable through some simple additions. * Add basic repository lfs management * add auto-associate function * Add functionality to find commits with this lfs file * Add link to find commits on the lfs file view * Adjust commit view to state the likely branch causing the commit * Only read Oid from database
* Fix #8582 by handling empty repos (#8587)Jonas Franz2019-10-192-0/+19
| | | | | | | | | | * Fix #8582 by handling empty repos Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix tests Signed-off-by: Jonas Franz <info@jonasfranz.software>
* Sign merges, CRUD, Wiki and Repository initialisation with gpg key (#7631)zeripath2019-10-163-8/+21
| | | | | | | | | | | | | | | | | | | This PR fixes #7598 by providing a configurable way of signing commits across the Gitea instance. Per repository configurability and import/generation of trusted secure keys is not provided by this PR - from a security PoV that's probably impossible to do properly. Similarly web-signing, that is asking the user to sign something, is not implemented - this could be done at a later stage however. ## Features - [x] If commit.gpgsign is set in .gitconfig sign commits and files created through repofiles. (merges should already have been signed.) - [x] Verify commits signed with the default gpg as valid - [x] Signer, Committer and Author can all be different - [x] Allow signer to be arbitrarily different - We still require the key to have an activated email on Gitea. A more complete implementation would be to use a keyserver and mark external-or-unactivated with an "unknown" trust level icon. - [x] Add a signing-key.gpg endpoint to get the default gpg pub key if available - Rather than add a fake web-flow user I've added this as an endpoint on /api/v1/signing-key.gpg - [x] Try to match the default key with a user on gitea - this is done at verification time - [x] Make things configurable? - app.ini configuration done - [x] when checking commits are signed need to check if they're actually verifiable too - [x] Add documentation I have decided that adjusting the docker to create a default gpg key is not the correct thing to do and therefore have not implemented this.
* Move AddTestPullRequestTask to pull service package from models (#8324)Lunny Xiao2019-10-151-1/+2
| | | | | | * move AddTestPullRequestTask to pull service package from models * fix fmt
* Restore functionality for early gits (#7775)zeripath2019-10-123-20/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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 * Restore tracking fetch change * Apply suggestions from code review * Update modules/repofiles/temp_repo.go
* Move git diff codes from models to services/gitdiff (#7889)Lunny Xiao2019-09-053-7/+10
| | | | | | | | | | * move git diff codes from models to services/gitdiff * fix template * fix test * fix template
* Use gitea forked macaron (#7933)Tamal Saha2019-08-231-1/+1
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* Add file status on API (#7671)Lunny Xiao2019-08-212-11/+15
| | | | | | | | | | * add file status on API * fix tests * fix tests * fix tests
* Convert files to utf-8 for indexing (#7814)guillep2k2019-08-151-10/+10
| | | | | | | | | | | | | | * 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
* Fix duplicate call of webhook (#7821)Antoine GIRARD2019-08-113-79/+0
|
* Be more strict with git arguments (#7715)zeripath2019-08-052-0/+13
| | | | | | * Be more strict with git arguments * fix-up commit test * use bindings for branch name
* Correct wrong datetime format for git (#7689)zeripath2019-07-311-1/+1
|
* Move commit repo action from models to repofiles package (#7645)Lunny Xiao2019-07-303-1/+338
| | | | | | * move commit repo action from models to repofiles package * fix unit tests
* Move models.PushUpdate to repofiles.PushUpdate (#7485)Lunny Xiao2019-07-241-2/+87
| | | | | | * move models.PushUpdate to repofiles.PushUpdate * remove duplicated code to load repo
* Removed unnecessary conversions (#7557)Christian Muehlhaeuser2019-07-231-1/+1
| | | No need to convert to the same type.
* Add commit statuses reports on pull request view (#6845)Lunny Xiao2019-06-301-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Fixes #7292 - API File Contents bug (#7301)Richard Mahn2019-06-294-65/+317
|
* Fixes #7152 - Allow create/update/delete message to be empty, use default ↵Richard Mahn2019-06-291-0/+5
| | | | | | | | | | message (#7324) * Fixes #7152 - Allow create/update/delete message to be empty, use default message * Linting fix * Fix to delete integration tests
* Monitor all git commands; move blame to git package and replace git as a ↵Lunny Xiao2019-06-261-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add golangci (#6418)kolaente2019-06-126-27/+26
|