Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
8134fe0e
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
8134fe0e
编写于
12月 05, 2011
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
git host fixed
上级
8f4a0bd1
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
14 addition
and
8 deletion
+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
未找到文件。
app/controllers/application_controller.rb
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录