Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5eb626b5
Commit
5eb626b5
authored
Jan 20, 2021
by
Simon Stieger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include submodule information for files in diff metadata
parent
ce7382e7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
app/serializers/diff_file_metadata_entity.rb
app/serializers/diff_file_metadata_entity.rb
+1
-0
changelogs/unreleased/285287-include-submodule-information-for-files-in-diff-metadata.yml
...lude-submodule-information-for-files-in-diff-metadata.yml
+5
-0
spec/serializers/diff_file_metadata_entity_spec.rb
spec/serializers/diff_file_metadata_entity_spec.rb
+27
-0
No files found.
app/serializers/diff_file_metadata_entity.rb
View file @
5eb626b5
...
...
@@ -7,6 +7,7 @@ class DiffFileMetadataEntity < Grape::Entity
expose
:old_path
expose
:new_file?
,
as: :new_file
expose
:deleted_file?
,
as: :deleted_file
expose
:submodule?
,
as: :submodule
expose
:file_identifier_hash
expose
:file_hash
end
changelogs/unreleased/285287-include-submodule-information-for-files-in-diff-metadata.yml
0 → 100644
View file @
5eb626b5
---
title
:
Include submodule information for files in diff metadata
merge_request
:
50346
author
:
Simon Stieger @sim0
type
:
fixed
spec/serializers/diff_file_metadata_entity_spec.rb
0 → 100644
View file @
5eb626b5
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
DiffFileMetadataEntity
do
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
)
}
let
(
:raw_diff_file
)
{
merge_request
.
merge_request_diff
.
diffs
.
raw_diff_files
.
first
}
let
(
:entity
)
{
described_class
.
new
(
raw_diff_file
)
}
context
'as json'
do
subject
{
entity
.
as_json
}
it
'exposes the expected fields'
do
expect
(
subject
.
keys
).
to
contain_exactly
(
:added_lines
,
:removed_lines
,
:new_path
,
:old_path
,
:new_file
,
:deleted_file
,
:submodule
,
:file_identifier_hash
,
:file_hash
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment