Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
8dc6929aff67
Commit
8dc6929a
authored
Dec 05, 2011
by
Dmitriy Zaporozhets
Browse files
git host fixed
parent
6d29d7a25f07
Changes
7
Hide whitespace changes
Inline
Side-by-side
app/controllers/application_controller.rb
View file @
8dc6929a
...
...
@@ -70,7 +70,7 @@
end
def
require_non_empty_project
redirect_to
@project
unless
@project
.
repo_exists?
redirect_to
@project
unless
@project
.
repo_exists?
&&
@project
.
has_commits?
end
def
respond_with_notes
...
...
app/controllers/projects_controller.rb
View file @
8dc6929a
...
...
@@ -65,7 +65,7 @@
end
def
show
return
render
"projects/empty"
unless
@project
.
repo_exists?
return
render
"projects/empty"
unless
@project
.
repo_exists?
&&
@project
.
has_commits?
limit
=
(
params
[
:limit
]
||
20
).
to_i
@activities
=
@project
.
cached_updates
(
limit
)
end
...
...
app/controllers/refs_controller.rb
View file @
8dc6929a
...
...
@@ -52,6 +52,8 @@
@commit
=
project
.
commit
(
@ref
)
@tree
=
Tree
.
new
(
@commit
.
tree
,
project
,
@ref
,
params
[
:path
])
@tree
=
TreeDecorator
.
new
(
@tree
)
rescue
return
render_404
end
def
ref
...
...
app/models/key.rb
View file @
8dc6929a
...
...
@@ -19,7 +19,7 @@
end
def
update_gitosis
Git
oProxy
.
system
.
new
.
configure
do
|
c
|
Git
labhq
::
GitHost
.
system
.
new
.
configure
do
|
c
|
c
.
update_keys
(
identifier
,
key
)
projects
.
each
do
|
project
|
...
...
@@ -29,7 +29,7 @@
end
def
gitosis_delete_key
Git
oProxy
.
system
.
new
.
configure
do
|
c
|
Git
labhq
::
GitHost
.
system
.
new
.
configure
do
|
c
|
c
.
delete_key
(
identifier
)
projects
.
each
do
|
project
|
...
...
app/models/project.rb
View file @
8dc6929a
...
...
@@ -95,6 +95,10 @@
notes
.
where
(
:noteable_id
=>
commit
.
id
,
:noteable_type
=>
"Commit"
)
end
def
has_commits?
!!
commit
end
def
add_access
(
user
,
*
access
)
opts
=
{
:user
=>
user
}
access
.
each
{
|
name
|
opts
.
merge!
(
name
=>
true
)
}
...
...
config/gitlab.yml
View file @
8dc6929a
...
...
@@ -11,7 +11,7 @@
# But gitosis wiil be deprecated &
# some new features wont work with it
git_host
:
system
:
gitolite
# or gitosis
system
:
gitolite
admin_uri
:
git@localhost:gitolite-admin
base_path
:
/home/git/repositories/
host
:
localhost
...
...
lib/gitlabhq/git_host.rb
View file @
8dc6929a
...
...
@@ -4,5 +4,7 @@
module
Gitlabhq
class
GitHost
def
self
.
system
if
GIT_HOST
[
"system"
]
==
"gitolite"
if
GIT_HOST
[
"system"
]
==
"gitosis"
Gitlabhq
::
Gitosis
else
Gitlabhq
::
Gitolite
...
...
@@ -8,6 +10,4 @@
Gitlabhq
::
Gitolite
else
Gitlabhq
::
Gitosis
end
end
...
...
Write
Preview
Supports
Markdown
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