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
ef5b36ea
Commit
ef5b36ea
authored
Jan 04, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed protected branches and file edit
parent
afbdbb0c
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
20 deletions
+21
-20
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+2
-2
app/controllers/tree_controller.rb
app/controllers/tree_controller.rb
+1
-1
app/models/users_project.rb
app/models/users_project.rb
+0
-10
app/views/protected_branches/index.html.haml
app/views/protected_branches/index.html.haml
+1
-1
app/views/repositories/_feed.html.haml
app/views/repositories/_feed.html.haml
+1
-1
features/steps/project/create_project.rb
features/steps/project/create_project.rb
+2
-2
features/steps/project/project_browse_commits.rb
features/steps/project/project_browse_commits.rb
+1
-1
spec/models/commit_spec.rb
spec/models/commit_spec.rb
+1
-1
spec/support/stubbed_repository.rb
spec/support/stubbed_repository.rb
+12
-1
No files found.
app/controllers/admin/users_controller.rb
View file @
ef5b36ea
...
@@ -19,9 +19,9 @@ class Admin::UsersController < AdminController
...
@@ -19,9 +19,9 @@ class Admin::UsersController < AdminController
def
team_update
def
team_update
@admin_user
=
User
.
find
(
params
[
:id
])
@admin_user
=
User
.
find
(
params
[
:id
])
UsersProject
.
user_bulk_import
(
UsersProject
.
add_users_into_projects
(
@admin_user
,
params
[
:project_ids
],
params
[
:project_ids
],
[
@admin_user
.
id
],
params
[
:project_access
]
params
[
:project_access
]
)
)
...
...
app/controllers/tree_controller.rb
View file @
ef5b36ea
...
@@ -22,7 +22,7 @@ class TreeController < ProjectResourceController
...
@@ -22,7 +22,7 @@ class TreeController < ProjectResourceController
end
end
def
edit
def
edit
@last_commit
=
@project
.
last_commit_for
(
@ref
,
@path
).
sha
@last_commit
=
@project
.
repository
.
last_commit_for
(
@ref
,
@path
).
sha
end
end
def
update
def
update
...
...
app/models/users_project.rb
View file @
ef5b36ea
...
@@ -128,16 +128,6 @@ class UsersProject < ActiveRecord::Base
...
@@ -128,16 +128,6 @@ class UsersProject < ActiveRecord::Base
end
end
end
end
# TODO: depreceate in future in favor of add_users_into_projects
def
bulk_import
(
project
,
user_ids
,
project_access
)
add_users_into_projects
([
project
.
id
],
user_ids
,
project_access
)
end
# TODO: depreceate in future in favor of add_users_into_projects
def
user_bulk_import
(
user
,
project_ids
,
project_access
)
add_users_into_projects
(
project_ids
,
[
user
.
id
],
project_access
)
end
def
roles_hash
def
roles_hash
{
{
guest:
GUEST
,
guest:
GUEST
,
...
...
app/views/protected_branches/index.html.haml
View file @
ef5b36ea
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
%td
%td
=
link_to
project_commits_path
(
@project
,
branch
.
name
)
do
=
link_to
project_commits_path
(
@project
,
branch
.
name
)
do
%strong
=
branch
.
name
%strong
=
branch
.
name
-
if
branch
.
name
==
@project
.
root_ref
-
if
@project
.
root_ref?
(
branch
.
name
)
%span
.label
default
%span
.label
default
%td
%td
-
if
branch
.
commit
-
if
branch
.
commit
...
...
app/views/repositories/_feed.html.haml
View file @
ef5b36ea
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
=
link_to
project_commits_path
(
@project
,
commit
.
head
.
name
)
do
=
link_to
project_commits_path
(
@project
,
commit
.
head
.
name
)
do
%strong
%strong
=
commit
.
head
.
name
=
commit
.
head
.
name
-
if
commit
.
head
.
name
==
@project
.
root_ref
-
if
@project
.
root_ref?
(
commit
.
head
.
name
)
%span
.label
default
%span
.label
default
%td
%td
...
...
features/steps/project/create_project.rb
View file @
ef5b36ea
...
@@ -3,13 +3,13 @@ class CreateProject < Spinach::FeatureSteps
...
@@ -3,13 +3,13 @@ class CreateProject < Spinach::FeatureSteps
include
SharedPaths
include
SharedPaths
And
'fill project form with valid data'
do
And
'fill project form with valid data'
do
fill_in
'project_name'
,
:with
=>
'NewProject
'
fill_in
'project_name'
,
with:
'Empty
'
click_button
"Create project"
click_button
"Create project"
end
end
Then
'I should see project page'
do
Then
'I should see project page'
do
current_path
.
should
==
project_path
(
Project
.
last
)
current_path
.
should
==
project_path
(
Project
.
last
)
page
.
should
have_content
"
NewProject
"
page
.
should
have_content
"
Empty
"
end
end
And
'I should see empty project instuctions'
do
And
'I should see empty project instuctions'
do
...
...
features/steps/project/project_browse_commits.rb
View file @
ef5b36ea
...
@@ -48,7 +48,7 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
...
@@ -48,7 +48,7 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
page
.
should
have_selector
(
'ul.breadcrumb span.divider'
,
count:
3
)
page
.
should
have_selector
(
'ul.breadcrumb span.divider'
,
count:
3
)
page
.
should
have_selector
(
'ul.breadcrumb a'
,
count:
4
)
page
.
should
have_selector
(
'ul.breadcrumb a'
,
count:
4
)
find
(
'ul.breadcrumb li:first a'
)[
'href'
].
should
match
(
/
#{
@project
.
path
}
\/commits\/master\z/
)
find
(
'ul.breadcrumb li:first a'
)[
'href'
].
should
match
(
/
#{
@project
.
path
_with_namespace
}
\/commits\/master\z/
)
find
(
'ul.breadcrumb li:last a'
)[
'href'
].
should
match
(
%r{master/app/models/project
\.
rb
\z
}
)
find
(
'ul.breadcrumb li:last a'
)[
'href'
].
should
match
(
%r{master/app/models/project
\.
rb
\z
}
)
end
end
...
...
spec/models/commit_spec.rb
View file @
ef5b36ea
require
'spec_helper'
require
'spec_helper'
describe
Commit
do
describe
Commit
do
let
(
:commit
)
{
create
(
:project
).
commit
}
let
(
:commit
)
{
create
(
:project
).
repository
.
commit
}
describe
CommitDecorator
do
describe
CommitDecorator
do
let
(
:decorator
)
{
CommitDecorator
.
new
(
commit
)
}
let
(
:decorator
)
{
CommitDecorator
.
new
(
commit
)
}
...
...
spec/support/stubbed_repository.rb
View file @
ef5b36ea
require
"repository"
require
"project"
# Stubs out all Git repository access done by models so that specs can run
# Stubs out all Git repository access done by models so that specs can run
# against fake repositories without Grit complaining that they don't exist.
# against fake repositories without Grit complaining that they don't exist.
class
Project
class
Project
def
repository
if
path
==
"empty"
||
!
path
nil
else
GitLabTestRepo
.
new
(
path_with_namespace
)
end
end
def
satellite
def
satellite
FakeSatellite
.
new
FakeSatellite
.
new
end
end
...
@@ -16,7 +27,7 @@ class Project
...
@@ -16,7 +27,7 @@ class Project
end
end
end
end
class
Repository
class
GitLabTestRepo
<
Repository
def
repo
def
repo
@repo
||=
Grit
::
Repo
.
new
(
Rails
.
root
.
join
(
'tmp'
,
'repositories'
,
'gitlabhq'
))
@repo
||=
Grit
::
Repo
.
new
(
Rails
.
root
.
join
(
'tmp'
,
'repositories'
,
'gitlabhq'
))
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