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
413a310f
Commit
413a310f
authored
Apr 03, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed blame and mr factory
parent
7e8bf92b
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
10 deletions
+15
-10
app/controllers/blame_controller.rb
app/controllers/blame_controller.rb
+1
-0
app/views/blame/show.html.haml
app/views/blame/show.html.haml
+3
-3
app/views/blob/_actions.html.haml
app/views/blob/_actions.html.haml
+1
-1
app/workers/post_receive.rb
app/workers/post_receive.rb
+1
-1
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+1
-1
spec/factories.rb
spec/factories.rb
+5
-3
spec/lib/git/commit_spec.rb
spec/lib/git/commit_spec.rb
+2
-0
spec/support/matchers.rb
spec/support/matchers.rb
+1
-1
No files found.
app/controllers/blame_controller.rb
View file @
413a310f
...
@@ -8,6 +8,7 @@ class BlameController < ProjectResourceController
...
@@ -8,6 +8,7 @@ class BlameController < ProjectResourceController
before_filter
:require_non_empty_project
before_filter
:require_non_empty_project
def
show
def
show
@blob
=
Gitlab
::
Git
::
Blob
.
new
(
@repository
,
@commit
.
id
,
@ref
,
@path
)
@blame
=
Gitlab
::
Git
::
Blame
.
new
(
project
.
repository
,
@commit
.
id
,
@path
)
@blame
=
Gitlab
::
Git
::
Blame
.
new
(
project
.
repository
,
@commit
.
id
,
@path
)
end
end
end
end
app/views/blame/show.html.haml
View file @
413a310f
...
@@ -15,9 +15,9 @@
...
@@ -15,9 +15,9 @@
.file_title
.file_title
%i
.icon-file
%i
.icon-file
%span
.file_name
%span
.file_name
=
@
tree
.
name
=
@
blob
.
name
%small
=
number_to_human_size
@
tree
.
size
%small
=
number_to_human_size
@
blob
.
size
%span
.options
=
render
"
tree/blob_
actions"
%span
.options
=
render
"
blob/
actions"
.file_content.blame
.file_content.blame
%table
%table
-
current_line
=
1
-
current_line
=
1
...
...
app/views/blob/_actions.html.haml
View file @
413a310f
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
-# only show normal/blame view links for text files
-# only show normal/blame view links for text files
-
if
@blob
.
text?
-
if
@blob
.
text?
-
if
current_page?
project_blame_path
(
@project
,
@id
)
-
if
current_page?
project_blame_path
(
@project
,
@id
)
=
link_to
"normal view"
,
project_
tree
_path
(
@project
,
@id
),
class:
"btn btn-tiny"
=
link_to
"normal view"
,
project_
blob
_path
(
@project
,
@id
),
class:
"btn btn-tiny"
-
else
-
else
=
link_to
"blame"
,
project_blame_path
(
@project
,
@id
),
class:
"btn btn-tiny"
=
link_to
"blame"
,
project_blame_path
(
@project
,
@id
),
class:
"btn btn-tiny"
=
link_to
"history"
,
project_commits_path
(
@project
,
@id
),
class:
"btn btn-tiny"
=
link_to
"history"
,
project_commits_path
(
@project
,
@id
),
class:
"btn btn-tiny"
app/workers/post_receive.rb
View file @
413a310f
...
@@ -23,7 +23,7 @@ class PostReceive
...
@@ -23,7 +23,7 @@ class PostReceive
user
=
if
identifier
.
blank?
user
=
if
identifier
.
blank?
# Local push from gitlab
# Local push from gitlab
email
=
project
.
repository
.
commit
(
newrev
).
author
.
email
rescue
nil
email
=
project
.
repository
.
commit
(
newrev
).
author
_
email
rescue
nil
User
.
find_by_email
(
email
)
if
email
User
.
find_by_email
(
email
)
if
email
elsif
identifier
=~
/\Auser-\d+\Z/
elsif
identifier
=~
/\Auser-\d+\Z/
...
...
features/steps/shared/paths.rb
View file @
413a310f
...
@@ -205,7 +205,7 @@ module SharedPaths
...
@@ -205,7 +205,7 @@ module SharedPaths
end
end
Given
'I visit blob file from repo'
do
Given
'I visit blob file from repo'
do
visit
project_
tree
_path
(
@project
,
File
.
join
(
ValidCommit
::
ID
,
ValidCommit
::
BLOB_FILE_PATH
))
visit
project_
blob
_path
(
@project
,
File
.
join
(
ValidCommit
::
ID
,
ValidCommit
::
BLOB_FILE_PATH
))
end
end
Given
'I visit project source page for "8470d70"'
do
Given
'I visit project source page for "8470d70"'
do
...
...
spec/factories.rb
View file @
413a310f
...
@@ -86,9 +86,11 @@ FactoryGirl.define do
...
@@ -86,9 +86,11 @@ FactoryGirl.define do
target_branch
"master"
# pretend bcf03b5d~3
target_branch
"master"
# pretend bcf03b5d~3
source_branch
"stable"
# pretend bcf03b5d
source_branch
"stable"
# pretend bcf03b5d
st_commits
do
st_commits
do
[
Commit
.
new
(
project
.
repository
.
commit
(
'bcf03b5d'
)),
[
Commit
.
new
(
project
.
repository
.
commit
(
'bcf03b5d~1'
)),
project
.
repository
.
commit
(
'bcf03b5d'
).
to_hash
,
Commit
.
new
(
project
.
repository
.
commit
(
'bcf03b5d~2'
))]
project
.
repository
.
commit
(
'bcf03b5d~1'
).
to_hash
,
project
.
repository
.
commit
(
'bcf03b5d~2'
).
to_hash
]
end
end
st_diffs
do
st_diffs
do
project
.
repo
.
diff
(
"bcf03b5d~3"
,
"bcf03b5d"
)
project
.
repo
.
diff
(
"bcf03b5d~3"
,
"bcf03b5d"
)
...
...
spec/lib/git/commit_spec.rb
View file @
413a310f
...
@@ -20,6 +20,8 @@ describe Gitlab::Git::Commit do
...
@@ -20,6 +20,8 @@ describe Gitlab::Git::Commit do
author:
@author
,
author:
@author
,
committer:
@committer
,
committer:
@committer
,
committed_date:
Date
.
yesterday
,
committed_date:
Date
.
yesterday
,
authored_date:
Date
.
yesterday
,
parents:
[],
message:
'Refactoring specs'
message:
'Refactoring specs'
)
)
...
...
spec/support/matchers.rb
View file @
413a310f
...
@@ -3,7 +3,7 @@ RSpec::Matchers.define :be_valid_commit do
...
@@ -3,7 +3,7 @@ RSpec::Matchers.define :be_valid_commit do
actual
!=
nil
actual
!=
nil
actual
.
id
==
ValidCommit
::
ID
actual
.
id
==
ValidCommit
::
ID
actual
.
message
==
ValidCommit
::
MESSAGE
actual
.
message
==
ValidCommit
::
MESSAGE
actual
.
author
.
name
==
ValidCommit
::
AUTHOR_FULL_NAME
actual
.
author
_
name
==
ValidCommit
::
AUTHOR_FULL_NAME
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