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
Kazuhiko Shiozaki
gitlab-ce
Commits
fed10766
Commit
fed10766
authored
Jan 09, 2016
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken spec for submodule commit. #3945
parent
164c6374
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
lib/gitlab/diff/highlight.rb
lib/gitlab/diff/highlight.rb
+10
-2
No files found.
lib/gitlab/diff/highlight.rb
View file @
fed10766
...
@@ -85,10 +85,14 @@ module Gitlab
...
@@ -85,10 +85,14 @@ module Gitlab
case
diff_line
.
type
case
diff_line
.
type
when
'new'
,
nil
when
'new'
,
nil
diff_line
.
text
=
new_lines
[
diff_line
.
new_pos
-
1
].
try
(
:gsub!
,
/\A\s/
,
line_prefix
)
line
=
new_lines
[
diff_line
.
new_pos
-
1
]
when
'old'
when
'old'
diff_line
.
text
=
old_lines
[
diff_line
.
old_pos
-
1
].
try
(
:gsub!
,
/\A\s/
,
line_prefix
)
line
=
old_lines
[
diff_line
.
old_pos
-
1
]
end
end
# Only update text if line is found. This will prevent
# issues with submodules given the line only exists in diff content.
diff_line
.
text
=
line
.
gsub!
(
/\A\s/
,
line_prefix
)
if
line
end
end
@lines
@lines
...
@@ -121,6 +125,10 @@ module Gitlab
...
@@ -121,6 +125,10 @@ module Gitlab
lines
.
map!
{
|
line
|
"
#{
line
}
"
}
lines
.
map!
{
|
line
|
"
#{
line
}
"
}
end
end
end
end
def
submodules
@submodules
||=
diff_repository
.
raw_repository
.
submodules
(
diff_new_ref
).
keys
end
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