Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
d68ec5e0
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,发现更多精彩内容 >>
提交
d68ec5e0
编写于
12月 07, 2011
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
default_branch for project & fixed project destroy
上级
2552a877
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
18 addition
and
6 deletion
+18
-6
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+1
-1
app/models/project.rb
app/models/project.rb
+1
-1
app/views/layouts/project.html.haml
app/views/layouts/project.html.haml
+1
-1
app/views/projects/_form.html.haml
app/views/projects/_form.html.haml
+6
-0
db/migrate/20111207211728_add_default_branch_to_project.rb
db/migrate/20111207211728_add_default_branch_to_project.rb
+5
-0
db/schema.rb
db/schema.rb
+3
-2
lib/gitlabhq/gitolite.rb
lib/gitlabhq/gitolite.rb
+1
-1
未找到文件。
app/controllers/application_controller.rb
浏览文件 @
d68ec5e0
...
...
@@ -61,7 +61,7 @@ class ApplicationController < ActionController::Base
else
@branch
=
params
[
:branch
].
blank?
?
nil
:
params
[
:branch
]
@tag
=
params
[
:tag
].
blank?
?
nil
:
params
[
:tag
]
@ref
=
@branch
||
@tag
||
Repository
.
default_ref
@ref
=
@branch
||
@tag
||
@project
.
try
(
:default_branch
)
||
Repository
.
default_ref
end
end
...
...
app/models/project.rb
浏览文件 @
d68ec5e0
...
...
@@ -158,7 +158,7 @@ class Project < ActiveRecord::Base
end
def
root_ref
"master"
default_branch
||
"master"
end
def
public?
...
...
app/views/layouts/project.html.haml
浏览文件 @
d68ec5e0
...
...
@@ -49,7 +49,7 @@
%span
{
:class
=>
"number"
}=
@project
.
snippets
.
non_expired
.
count
-
if
can?
current_user
,
:admin_project
,
@project
=
link_to
"
Project
"
,
edit_project_path
(
@project
),
:class
=>
(
current_page?
(
edit_project_path
(
@project
)))
?
"current"
:
nil
=
link_to
"
Admin
"
,
edit_project_path
(
@project
),
:class
=>
(
current_page?
(
edit_project_path
(
@project
)))
?
"current"
:
nil
.medium-tags
{
:style
=>
'padding: 10px 0 0 10px; width: 210px;'
}=
tag_list
@project
...
...
app/views/projects/_form.html.haml
浏览文件 @
d68ec5e0
...
...
@@ -29,6 +29,11 @@
%cite
.right
=
"http://
#{
GIT_HOST
[
"host"
]
}
/"
%td
=
f
.
text_field
:code
,
:placeholder
=>
"example"
-
unless
@project
.
heads
.
empty?
%tr
%td
=
f
.
label
:default_branch
,
"Default Branch"
%td
=
f
.
select
(
:default_branch
,
@project
.
heads
.
map
(
&
:name
),
{},
:style
=>
"width:300px;"
)
%tr
%td
=
f
.
label
:tag_list
%td
=
f
.
text_area
:tag_list
,
:placeholder
=>
"project tags"
,
:style
=>
"height:50px"
,
:id
=>
:tag_field
...
...
@@ -57,4 +62,5 @@
:javascript
$
(
function
(){
taggifyForm
();
$
(
'
form #project_default_branch
'
).
chosen
();
})
db/migrate/20111207211728_add_default_branch_to_project.rb
0 → 100644
浏览文件 @
d68ec5e0
class
AddDefaultBranchToProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:default_branch
,
:string
,
:null
=>
false
,
:default
=>
"master"
end
end
db/schema.rb
浏览文件 @
d68ec5e0
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
:version
=>
2011120
6222316
)
do
ActiveRecord
::
Schema
.
define
(
:version
=>
2011120
7211728
)
do
create_table
"features"
,
:force
=>
true
do
|
t
|
t
.
string
"name"
...
...
@@ -76,9 +76,10 @@ ActiveRecord::Schema.define(:version => 20111206222316) do
t
.
text
"description"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
boolean
"private_flag"
,
:default
=>
true
,
:null
=>
false
t
.
boolean
"private_flag"
,
:default
=>
true
,
:null
=>
false
t
.
string
"code"
t
.
integer
"owner_id"
t
.
string
"default_branch"
,
:default
=>
"master"
,
:null
=>
false
end
create_table
"snippets"
,
:force
=>
true
do
|
t
|
...
...
lib/gitlabhq/gitolite.rb
浏览文件 @
d68ec5e0
...
...
@@ -42,7 +42,7 @@ module Gitlabhq
end
def
destroy_project
(
project
)
`sudo -u git rm -rf
#{
project
.
path_to_repo
}
`
FileUtils
.
rm_rf
(
project
.
path_to_repo
)
ga_repo
=
::
Gitolite
::
GitoliteAdmin
.
new
(
File
.
join
(
@local_dir
,
'gitolite'
))
conf
=
ga_repo
.
config
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录