summaryrefslogtreecommitdiff
path: root/app/services/files
Commit message (Collapse)AuthorAgeFilesLines
* Add start_sha to commits APIMarkus Koller2019-07-181-0/+1
| | | | | | | | | | When passing start_branch on committing from the WebIDE, it's possible that the branch has changed since editing started, which results in the change being applied on top of the latest commit in the branch and overwriting the new changes. By passing the start_sha instead we can make sure that the change is applied on top of the commit which the user started editing from.
* CE backport for changes in EE MR 138949490-record-repository_type-on-lfs_objects_projects-ceLuke Duncalfe2019-06-172-2/+2
| | | | | | | | | | | | | | | | | | | | This backports to CE changes that allow the recording of the repository_type in the table lfs_objects_projects. This is in order to allow future pruning of unreferenced LFS objects, as we will need to know which repository to look in for the LFS pointer file. The EE MR that contains the original code and a full explanation of the changes is https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13894 EE Issue https://gitlab.com/gitlab-org/gitlab-ee/issues/9490 Note that there was a lot of CE code changed in the EE MR because we want to allow the wiki repository to also use LFS. See https://gitlab.com/gitlab-org/gitlab-ce/issues/43721. As the wiki is an unlicensed feature, a full backport is required to enable this.
* Externalize several strings inMartin Wortschack2019-04-161-1/+1
| | | | | | - app/services - app/controllers - app/presenters
* Externalize strings detected by rubocop-i18nMartin Wortschack2019-04-151-1/+1
| | | | | | - Externalize strings in milestones_helper - Externalize strings in app/services - Update PO file
* Accept force option on commit via APIPatrick Bajao2019-03-061-1/+2
| | | | | | | | When `force` is set to `true` and `start_branch` is set, the branch will be ovewritten with the new commit based on the `HEAD` of the `start_branch`. This commit includes changes to update the `gitaly-proto` gem.
* Commits API: Preserve file content in move operations if unspecifiedNick Thomas2018-11-281-0/+11
|
* Adds chmod action to POST /projects/:id/repository/commits APIJacopo2018-09-271-1/+1
| | | | With this action the user can update the execute_filemode of a given file in the repository.
* Use the correct email address when committing via a file serviceNick Thomas2018-09-171-2/+4
|
* Uploads to wiki stored inside the wiki git repositoryFrancisco Javier López2018-09-041-2/+2
|
* Enable frozen string in apps/services/**/*.rbrepo-forks/gitlab-ce-frozen-string-enable-apps-services-innergfyoung2018-07-166-0/+12
| | | | | | For directories application_settings --> labels. Partially addresses #47424.
* Use correct encoding with Lfs::FileTransfromerJames Edwards-Jones2018-03-151-2/+3
|
* Avoid failed integrity check by linking LfsObjectProjects soonerJames Edwards-Jones2018-03-152-8/+9
| | | | | Attempted commits were failing due to the pre-recieve LfsIntegrity check. This is skipped during tests making this failure silent.
* Multi-file upload and Commit API obey LFS filtersJames Edwards-Jones2018-03-152-6/+24
| | | | | | | | Updates Files::MultiService for the commits API which is in turn used by the multi-file upload web UI Ensures that files which should be in LFS are transformed into LFS pointers Uses Lfs::Transformer which then links LfsObjectProjects on success
* Rename Lfs::FileModificationHandler to Lfs::FileTransformerJames Edwards-Jones2018-03-151-1/+1
|
* File upload UI obeys LFS filtersJames Edwards-Jones2018-02-061-1/+11
| | | | | | | | | | | Uses Lfs::FileModificationHandler to coordinate LFS detection, creation of LfsObject, etc Caveats: 1. This isn't used by the multi-file editor / Web IDE 2. This isn't used on rename. We'd need to be able to download LFS files and add them to the commit if they no longer match so not as simple. 3. We only check the root .gitattributes file, so this should be improved to correctly check for nested .gitattributes files in subfolders.
* Move git operations for multi_action into Gitlab::GitAlejandro Rodríguez2018-01-051-11/+4
|
* Updates from last code review:38356-add-last_commit_sha-to-the-commit-apiRubén Dávila2017-12-204-27/+33
| | | | | | - Apply some refactoring for code reuse - Add file status validation for Files::DeleteService - Write additional specs
* Check if file has been modified for each action provided.Rubén Dávila2017-12-201-0/+12
| | | | | | When commiting multiple files we're now checking if any of those files has been modified by another commit and we're rejecting the new commit in this case.
* Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon2017-06-211-2/+2
|
* Refactor changing files in web UIDouwe Maan2017-04-206-249/+43
|
* Fix variable name and change copyDouwe Maan2017-03-011-1/+1
|
* Fix creating a file in an empty repo using the APIDouwe Maan2017-03-011-10/+6
|
* Enable and autocorrect the CustomErrorClass copSean McGivern2017-03-013-3/+3
|
* Fix specdm-fix-web-edit-new-linesDouwe Maan2017-02-243-5/+5
|
* Add newlineDouwe Maan2017-02-241-0/+1
|
* Raise error when no content is providedDouwe Maan2017-02-243-7/+23
|
* Address reviewDouwe Maan2017-02-241-6/+6
|
* Rename commit_file, commit_dir and remove_file and update specsDouwe Maan2017-02-243-4/+3
|
* Consistently create, update, and delete files, taking CRLF settings into accountDouwe Maan2017-02-241-3/+11
|
* Change branch_name param to branch throughout V4 API22132-rename-branch-name-params-to-branchOswaldo Ferreira2017-02-211-4/+4
|
* Rename Files::DeleteService to Files::DestroyServicedixpac2017-02-101-1/+1
| | | | | Reason for renaming is to comply with naming convention of services in codebase.
* Rename from base to start because base could mean merge baseLin Jen-Shin2017-01-066-18/+18
|
* Rename source to base to avoid confusion from MRLin Jen-Shin2017-01-066-18/+18
|
* Fix source_project and also pass source_projectLin Jen-Shin2016-12-144-0/+4
| | | | | Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_19747556
* Cleanup parameters, easier to understand andLin Jen-Shin2016-12-085-15/+15
| | | | more consistent across different methodst
* Prefer repository.branch_exists?Lin Jen-Shin2016-12-081-3/+3
|
* Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin2016-11-245-10/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix-git-hooks-when-creating-file * upstream/master: (141 commits) Log mv_namespace parameters Remove header ids from University docs Added test that checks the correct select box is there for the LFS enabled setting. Simplify copy on "Create a new list" dropdown in Issue Boards Fix `LFS enabled` select box. Use Commit#author so we share logic and cache Move admin abuse report spinach test to rspec fixes non-retina shadow and browser zoom issue Use default `closest` if available! Adds polyfill for CustomEvent Move abuse report spinach test to rspec Add support of Chrome/Chromium in requirements.md Fixed dragging issues on issue boards Grapify the sidekiq metrics API Add nested groups support to the routing Correctly determine mergeability of MR with no discussions API: Add endpoint to delete a group share Add a starting date to milestones Update ProjectTeam#fetch_members to use project authorizations Update ProjectTeam#max_member_access_for_user_ids to use project authorizations ...
| * Remove unnecessary require_relative calls from service classesSemyon Pupkov2016-11-225-10/+0
| | | | | | | | | | Rails by default use autoload for all dirs from app folder. require_relative not needed. See ActiveSupport::Dependencies.autoload_paths
* | Move all branch creation to raw_ensure_branch,Lin Jen-Shin2016-11-222-12/+2
| | | | | | | | and keep it only called in update_branch_with_hooks.
* | Add a few comments to explain implementation detailLin Jen-Shin2016-11-151-0/+3
| |
* | Make sure we have the branch on the other projectLin Jen-Shin2016-11-151-1/+9
| |
* | Add `source_branch` option for various git operationsLin Jen-Shin2016-11-156-11/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | If `source_branch` option is passed, and target branch cannot be found, `Repository#update_branch_with_hooks` would try to create a new branch from `source_branch`. This way, we could make changes in the new branch while only firing the hooks once for the changes. Previously, we can only create a new branch first then make changes to the new branch, firing hooks twice. This behaviour is bad for CI. Fixes #7237
* | Revert "Don't execute git hooks if you create branch as part of other change"Lin Jen-Shin2016-11-151-1/+1
| | | | | | | | This reverts commit a431ca0f8b7f8967e89a35caddf1e41e53eee290.
* | Don't execute git hooks if you create branch as part of other changeKamil Trzcinski2016-11-021-1/+1
|/ | | | | | | | | | | Currently, our procedure for adding a commit requires us to execute `CreateBranchService` before file creation. It's OK, but also we do execute `git hooks` (the `PostReceive` sidekiq job) as part of this process. However, this hook is execute before the file is actually committed, so the ref is updated. Secondly, we do execute a `git hooks` after committing file and updating ref. This results in duplicate `PostReceive` jobs, where the first one is completely invalid. This change makes the branch creation, something that is intermediate step of bigger process (file creation or update, commit cherry pick or revert) to not execute git hooks.
* multi-file commitMarc Siegfriedt2016-10-053-8/+133
| | | | | | add docs and tests - add additional validation allow move without content updated response
* Add optional 'author' param when making commitsDan Dunckel2016-09-195-4/+8
|
* Prevents accidental overwrites of commits from UIFrank West2016-08-152-0/+24
| | | | | | | | | | | | | Currently when a user performs an update of a file through the UI and there has already been a change committed to the file the previous commits will be overwritten without a check to see if the file has been changed. This commit uses the last commit sha at the time the user starts editing the file and compares it with the current sha of the file being edited to ensure they are the same before committing the file. If the shas do not match we throw an exception preventing the commit from the commit from occurring. Fixes #5857
* Merge branch 'master' into rename-repo-filestiagonbotelho2016-07-191-1/+1
|\
| * Revert "Revert "Merge branch '18193-developers-can-merge' into 'master' ""Rémy Coutable2016-07-181-1/+1
| | | | | | | | | | | | | | | | This reverts commit 530f5158e297f3cde27f3566cfe13bad74ba3b50. See !4892. Signed-off-by: Rémy Coutable <remy@rymai.me>
| * Revert "Merge branch '18193-developers-can-merge' into 'master' "Robert Speicher2016-07-131-1/+1
| | | | | | | | | | This reverts commit 9ca633eb4c62231e4ddff5466c723cf8e2bdb25d, reversing changes made to fb229bbf7970ba908962b837b270adf56f14098f.