summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/conflict
Commit message (Collapse)AuthorAgeFilesLines
* Add frozen_string_literal to spec/lib (part 1)Thong Kuah2019-07-262-0/+4
| | | | | Using the sed script from https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
* Remove dependencies on LinguistZeger-Jan van de Weg2018-10-121-5/+0
| | | | | | | | | | | | | | | | This saves about 128 MB of baseline RAM usage per Unicorn and Sidekiq process (!). Linguist wasn't detecting languages anymore from CE/EE since 9ae8b57467ac8b38f1fa9020a466d94a93cbb9dd. However, Linguist::BlobHelper was still being depended on by BlobLike and others. This removes the Linguist gem, given it isn't required anymore. EscapeUtils were pulled in as dependency, but given Banzai depends on it, it is now added explicitly. Previously, Linguist was used to detect the best ACE mode. Instead, we rely on ACE to guess the best mode based on the file extension.
* Remove Gitlab::Git::Repository#rugged and Gollum codeAlejandro Rodríguez2018-10-021-1/+3
| | | | | | | | Cleanup code, and refactor tests that still use Rugged. After this, there should be no Rugged code that access the instance's repositories on non-test environments. There is still some rugged code for other tasks like the repository import task, but since it doesn't access any repository storage path it can stay.
* Include rich_text in diff cache keysSean McGivern2018-08-281-4/+0
| | | | | | | Previously, this wasn't needed: text was normally set to the highlighted contents anyway. Now, it is: we store different things in text and rich_text. This caused https://gitlab.com/gitlab-com/production/issues/439.
* Add "deny disk access" Gitaly feature (tripswitch)Jacob Vosmaer (GitLab)2018-06-011-1/+1
|
* Cache `#can_be_resolved_in_ui?` git operationscache-refactorAlejandro Rodríguez2018-03-081-0/+32
|
* Fix conflict highlightingfix-conflict-highlightingSean McGivern2017-11-171-0/+7
| | | | | | | | | Conflicts used to take a `Repository` and pass that to `Gitlab::Highlight.highlight`, which would call `#gitattribute` on the repository. Now they use a `Gitlab::Git::Repository`, which didn't have that method defined - but defining it on `Gitlab::Git::Repository` does make it available on `Repository` through `method_missing`, so we can do that and both cases will work.
* Create a Gitlab::Git submodule for conlict-related filesAlejandro Rodríguez2017-10-121-4/+4
| | | | Rename classes to (hopefully) clearer names while we're doing that.
* Refactor conflict resolution to contain git ops within Gitlab::GitAlejandro Rodríguez2017-10-123-232/+10
| | | | | This prepares the codebase for a Gitaly migration. See https://gitlab.com/gitlab-org/gitaly/issues/553
* Use described_class when possibleRémy Coutable2017-07-272-3/+3
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Remove superfluous lib: true, type: redis, service: true, models: true, ↵Rémy Coutable2017-07-273-3/+3
| | | | | | services: true, no_db: true, api: true Signed-off-by: Rémy Coutable <remy@rymai.me>
* Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon2017-06-212-44/+44
|
* Fix conflict resolution from corrupted upstreamfix-conflict-resolution-with-corrupt-reposSean McGivern2017-05-121-1/+1
| | | | | | | | | | | | | | | | | I don't know why this happens exactly, but given an upstream and fork repository from a customer, both of which required GC, resolving conflicts would corrupt the fork so badly that it couldn't be cloned. This isn't a perfect fix for that case, because the MR may still need to be merged manually, but it does ensure that the repository is at least usable. My best guess is that when we generate the index for the conflict resolution (which we previously did in the target project), we obtain a reference to an OID that doesn't exist in the source, even though we already fetch the refs from the target into the source. Explicitly setting the source project as the place to get the merge index from seems to prevent repository corruption in this way.
* Allow resolving conflicts with non-ASCII charsallow-resolving-conflicts-in-utf-8Sean McGivern2017-03-151-30/+59
| | | | | | | | | | | | | | | | | We wanted to check that the text could be encoded as JSON, because conflict resolutions are passed back and forth in that format, so the file itself must be UTF-8. However, all strings from the repository come back without an encoding from Rugged, making them ASCII_8BIT. We force to UTF-8, and reject if it's invalid. This still leaves the problem of a file that 'looks like' UTF-8 (contains valid UTF-8 byte sequences), but isn't. However: 1. If the conflicts contain the problem bytes, the user will see that the file isn't displayed correctly. 2. If the problem bytes are outside of the conflict area, then we will write back the same bytes when we resolve the conflicts, even though we though the encoding was UTF-8.
* Use Namespace#full_path instead of #path where appropriatedm-more-namespace-full-pathDouwe Maan2017-02-231-1/+1
|
* Revert "Prefer leading style for Style/DotPosition"Douwe Maan2017-02-232-42/+42
| | | | This reverts commit cb10b725c8929b8b4460f89c9d96c773af39ba6b.
* Enable Style/WordArrayDouwe Maan2017-02-231-2/+2
|
* Prefer leading style for Style/DotPositionDouwe Maan2017-02-232-42/+42
|
* Use `:empty_project` where possible throughout spec/librs-empty_project-libRobert Speicher2017-01-251-1/+1
|
* Add blob_ace_mode to conflict content responseSean McGivern2016-10-131-0/+11
|
* Fix merge conflict size limitfix-allowed-conflict-sizeSean McGivern2016-09-071-2/+2
|
* Handle non-UTF-8 conflicts gracefully21247-mergerequestscontroller-conflicts-may-fail-with-iso-8859-dataSean McGivern2016-08-251-0/+5
| | | | | | | These can't be resolved in the UI because if they aren't in a UTF-8 compatible encoding, they can't be rendered as JSON. Even if they could, we would be implicitly changing the file encoding anyway, which seems like a bad idea.
* Find match line headers by backtrackingSean McGivern2016-08-121-0/+104
| | | | | This is more efficient for large files than performing a regex match on every single line.
* Add more tests for conflictsSean McGivern2016-08-122-5/+5
|
* Clarify Conflict::File#sections methodSean McGivern2016-08-121-11/+12
|
* Add blob_icon to conflict file JSONSean McGivern2016-08-121-0/+4
|
* Add blob_path to conflict file JSONSean McGivern2016-08-121-1/+9
|
* Use same resolution format on FE and BESean McGivern2016-08-121-2/+2
|
* Fix specsSean McGivern2016-08-121-3/+2
| | | | | | | | - Add match line header to expected result for `File#sections`. - Lowercase CSS colours. - Remove unused `diff_refs` keyword argument. - Rename `parent` -> `parent_file`, to be more explicit. - Skip an iteration when highlighting.
* Raise errors for large and binary filesSean McGivern2016-08-121-9/+17
|
* Auto-highlight conflict when rich_text is calledSean McGivern2016-08-121-5/+11
|
* Allow resolving conflicts in MR controllerSean McGivern2016-08-121-0/+66
|
* Handle multiple merge conflict files in collectionSean McGivern2016-08-123-12/+35
|
* Add backend for merge conflicts readingSean McGivern2016-08-122-0/+254