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
iv
gitlab-ce
Commits
f6a67fba
Commit
f6a67fba
authored
Oct 25, 2011
by
gitlabhq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #87
parent
9afee5ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
app/views/commits/_text_file.html.haml
app/views/commits/_text_file.html.haml
+10
-4
No files found.
app/views/commits/_text_file.html.haml
View file @
f6a67fba
-
line_old
=
0
-
line_new
=
0
-
lines_arr
=
diff
.
diff
.
lines
.
to_a
-
lines_arr
=
diff
.
diff
.
lines
.
to_a
-
line_old
=
lines_arr
[
2
].
match
(
/-(\d)/
)[
0
].
to_i
.
abs
rescue
0
-
lines_arr
.
each
do
|
line
|
-
line_new
=
lines_arr
[
2
].
match
(
/\+(\d)/
)[
0
].
to_i
.
abs
rescue
0
-
next
if
line
.
match
(
/^--- a/
)
-
lines
=
lines_arr
[
3
..-
1
].
join
-
next
if
line
.
match
(
/^\+\+\+ b/
)
-
lines
.
each_line
do
|
line
|
-
if
line
.
match
(
/^@@ -/
)
-
line_old
=
line
.
match
(
/\-[0-9]*/
)[
0
].
to_i
.
abs
rescue
0
-
line_new
=
line
.
match
(
/\+[0-9]*/
)[
0
].
to_i
.
abs
rescue
0
-
next
=
diff_line
(
line
,
line_new
,
line_old
)
=
diff_line
(
line
,
line_new
,
line_old
)
-
if
line
[
0
]
==
"+"
-
if
line
[
0
]
==
"+"
-
line_new
+=
1
-
line_new
+=
1
...
...
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