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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
db40c668
Commit
db40c668
authored
May 15, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Diff::File {old,new}_ref to {old,new}_sha
parent
d9a0188d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
lib/gitlab/diff/file.rb
lib/gitlab/diff/file.rb
+4
-4
lib/gitlab/diff/highlight.rb
lib/gitlab/diff/highlight.rb
+3
-3
No files found.
lib/gitlab/diff/file.rb
View file @
db40c668
...
@@ -52,20 +52,20 @@ module Gitlab
...
@@ -52,20 +52,20 @@ module Gitlab
def
content_commit
def
content_commit
return
unless
diff_refs
return
unless
diff_refs
repository
.
commit
(
deleted_file
?
old_ref
:
new_ref
)
repository
.
commit
(
deleted_file
?
?
old_sha
:
new_sha
)
end
end
def
old_content_commit
def
old_content_commit
return
unless
diff_refs
return
unless
diff_refs
repository
.
commit
(
old_
ref
)
repository
.
commit
(
old_
sha
)
end
end
def
old_
ref
def
old_
sha
diff_refs
.
try
(
:base_sha
)
diff_refs
.
try
(
:base_sha
)
end
end
def
new_
ref
def
new_
sha
diff_refs
.
try
(
:head_sha
)
diff_refs
.
try
(
:head_sha
)
end
end
...
...
lib/gitlab/diff/highlight.rb
View file @
db40c668
...
@@ -3,7 +3,7 @@ module Gitlab
...
@@ -3,7 +3,7 @@ module Gitlab
class
Highlight
class
Highlight
attr_reader
:diff_file
,
:diff_lines
,
:raw_lines
,
:repository
attr_reader
:diff_file
,
:diff_lines
,
:raw_lines
,
:repository
delegate
:old_path
,
:new_path
,
:old_
ref
,
:new_ref
,
to: :diff_file
,
prefix: :diff
delegate
:old_path
,
:new_path
,
:old_
sha
,
:new_sha
,
to: :diff_file
,
prefix: :diff
def
initialize
(
diff_lines
,
repository:
nil
)
def
initialize
(
diff_lines
,
repository:
nil
)
@repository
=
repository
@repository
=
repository
...
@@ -61,12 +61,12 @@ module Gitlab
...
@@ -61,12 +61,12 @@ module Gitlab
def
old_lines
def
old_lines
return
unless
diff_file
return
unless
diff_file
@old_lines
||=
Gitlab
::
Highlight
.
highlight_lines
(
self
.
repository
,
diff_old_
ref
,
diff_old_path
)
@old_lines
||=
Gitlab
::
Highlight
.
highlight_lines
(
self
.
repository
,
diff_old_
sha
,
diff_old_path
)
end
end
def
new_lines
def
new_lines
return
unless
diff_file
return
unless
diff_file
@new_lines
||=
Gitlab
::
Highlight
.
highlight_lines
(
self
.
repository
,
diff_new_
ref
,
diff_new_path
)
@new_lines
||=
Gitlab
::
Highlight
.
highlight_lines
(
self
.
repository
,
diff_new_
sha
,
diff_new_path
)
end
end
end
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