The problem is that we often go via a diff object constructed from the diffs
stored in the DB. Those diffs, by definition, don't overflow, so we don't have
access to the 'correct' `real_size` - that is stored on the MR diff object
iself.
* upstream/master: (1122 commits)
Update CHANGELOG.md for 8.16.2
Display project ID in project settings (!8572)
fixed points from comments to improve code quality
Update CHANGELOG.md for 8.14.8
Statisfy eslint
Add CHANGELOG entry
Fix access to the wiki code via HTTP when repository feature disabled
Display fullscreen button on small screens (!5302)
Prevent removing fields from dropdowns on input elements
fix for all themes
Return struct instead of multiple values
Fix race conditions for AuthorizedProjectsWorker
Add User#nested_groups and User#nested_projects methods
Fix spec failure due to timestamp ordering issue in mySQL
Fixed error with filter keyboard tests
`can?` already includes the `feature_available?` check
Test there is no Merge Request button when MRs are disabled
Ensure the correct Merge Request button is found
Add 409 conflict tests
Add CHANGELOG
...
Customers running old versions of GitLab may have MergeRequestDiffs with
the text ["--broken diff"] due to text generated by gitlab_git 1.0.3.
To avoid the Error 500, verify that each element is a type that gitlab_git
will accept before attempting to create a DiffCollection.
Closes#20776
* remove ref fetch (we do it during creation anyway)
* remove safe_head_commit_sha for diff compare (do not depend on the source branch)
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
- Preloading noteable we share the same noteable instance when more than one
discussion refers to the same noteable.
- Any other call to that object that is cached in that object will be for any
discussion.
- In those cases where merge_request_diff has all the sha stored to build a diff_refs get that
diff_refs using directly those sha instead accessing to the git repository to first get the
commits and later the sha.
* show commits count in the merge request version dropdown
* initialize base/start commit sha for old merge request diffs from repo
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Add merge_request_diff validation to merge_request model
* Improve initialize of merge_request_diff object
* Rename some merge_request_diff methods for clarity
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Since MergeRequestDiff is not about branches and current state of merge
request diff anymore I removed most of branch related method and added
validation for head/start/base commit sha. From this point
MergeRequestDiff is about saving diff between branches only once at moment of
creation. Once created MergeRequestDiff should not be changes. Because
of that we should not rely on changes in source/target branches when
read from MergeRequestDiff
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>