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
Tatuya Kamada
gitlab-ce
Commits
c062e56b
Commit
c062e56b
authored
Feb 14, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed commit diff: content of removed files displayed
parent
ae416a76
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+5
-3
app/views/commits/_diffs.html.haml
app/views/commits/_diffs.html.haml
+2
-1
No files found.
app/helpers/commits_helper.rb
View file @
c062e56b
...
@@ -53,11 +53,13 @@ module CommitsHelper
...
@@ -53,11 +53,13 @@ module CommitsHelper
lines_arr
=
diff_arr
lines_arr
=
diff_arr
lines_arr
.
each
do
|
line
|
lines_arr
.
each
do
|
line
|
next
if
line
.
match
(
/^\-\-\- \/dev\/null/
)
next
if
line
.
match
(
/^\+\+\+ \/dev\/null/
)
next
if
line
.
match
(
/^\-\-\- a/
)
next
if
line
.
match
(
/^\+\+\+ b/
)
full_line
=
html_escape
(
line
.
gsub
(
/\n/
,
''
))
full_line
=
html_escape
(
line
.
gsub
(
/\n/
,
''
))
next
if
line
.
match
(
/^--- \/dev\/null/
)
next
if
line
.
match
(
/^--- a/
)
next
if
line
.
match
(
/^\+\+\+ b/
)
if
line
.
match
(
/^@@ -/
)
if
line
.
match
(
/^@@ -/
)
next
if
line_old
==
1
&&
line_new
==
1
next
if
line_old
==
1
&&
line_new
==
1
type
=
"match"
type
=
"match"
...
...
app/views/commits/_diffs.html.haml
View file @
c062e56b
...
@@ -4,11 +4,12 @@
...
@@ -4,11 +4,12 @@
-
diffs
.
each_with_index
do
|
diff
,
i
|
-
diffs
.
each_with_index
do
|
diff
,
i
|
-
next
if
diff
.
diff
.
empty?
-
next
if
diff
.
diff
.
empty?
-
file
=
(
@commit
.
tree
/
diff
.
b_path
)
-
file
=
(
@commit
.
tree
/
diff
.
b_path
)
-
file
=
(
@commit
.
prev_commit
.
tree
/
diff
.
a_path
)
unless
file
-
next
unless
file
-
next
unless
file
.diff_file
.diff_file
.diff_file_header
.diff_file_header
-
if
diff
.
deleted_file
-
if
diff
.
deleted_file
%strong
{
:id
=>
"#{diff.
b
_path}"
}=
diff
.
a_path
%strong
{
:id
=>
"#{diff.
a
_path}"
}=
diff
.
a_path
-
else
-
else
=
link_to
tree_file_project_ref_path
(
@project
,
@commit
.
id
,
diff
.
b_path
)
do
=
link_to
tree_file_project_ref_path
(
@project
,
@commit
.
id
,
diff
.
b_path
)
do
%strong
{
:id
=>
"#{diff.b_path}"
}=
diff
.
b_path
%strong
{
:id
=>
"#{diff.b_path}"
}=
diff
.
b_path
...
...
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