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
Jérome Perrin
gitlab-ce
Commits
8134fe0e
Commit
8134fe0e
authored
Dec 05, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git host fixed
parent
8f4a0bd1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
8 deletions
+14
-8
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+1
-1
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
app/controllers/refs_controller.rb
app/controllers/refs_controller.rb
+2
-0
app/models/key.rb
app/models/key.rb
+2
-2
app/models/project.rb
app/models/project.rb
+4
-0
config/gitlab.yml
config/gitlab.yml
+1
-1
lib/gitlabhq/git_host.rb
lib/gitlabhq/git_host.rb
+3
-3
No files found.
app/controllers/application_controller.rb
View file @
8134fe0e
...
...
@@ -70,7 +70,7 @@ class ApplicationController < ActionController::Base
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 @
8134fe0e
...
...
@@ -65,7 +65,7 @@ class ProjectsController < ApplicationController
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 @
8134fe0e
...
...
@@ -52,6 +52,8 @@ class RefsController < ApplicationController
@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 @
8134fe0e
...
...
@@ -19,7 +19,7 @@ class Key < ActiveRecord::Base
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 @@ class Key < ActiveRecord::Base
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 @
8134fe0e
...
...
@@ -95,6 +95,10 @@ class Project < ActiveRecord::Base
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 @
8134fe0e
...
...
@@ -11,7 +11,7 @@ email:
# 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 @
8134fe0e
...
...
@@ -4,10 +4,10 @@ require File.join(Rails.root, "lib", "gitlabhq", "gitosis")
module
Gitlabhq
class
GitHost
def
self
.
system
if
GIT_HOST
[
"system"
]
==
"gitolite"
Gitlabhq
::
Gitolite
else
if
GIT_HOST
[
"system"
]
==
"gitosis"
Gitlabhq
::
Gitosis
else
Gitlabhq
::
Gitolite
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