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
3d7ee4bfb4b6
Commit
3d7ee4bf
authored
Dec 07, 2011
by
Dmitriy Zaporozhets
Browse files
default_branch for project & fixed project destroy
parent
2f6e0cf73442
Changes
7
Hide whitespace changes
Inline
Side-by-side
app/controllers/application_controller.rb
View file @
3d7ee4bf
...
...
@@ -61,7 +61,7 @@
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
View file @
3d7ee4bf
...
...
@@ -158,7 +158,7 @@
end
def
root_ref
"master"
default_branch
||
"master"
end
def
public?
...
...
app/views/layouts/project.html.haml
View file @
3d7ee4bf
...
...
@@ -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
View file @
3d7ee4bf
...
...
@@ -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
View file @
3d7ee4bf
class
AddDefaultBranchToProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:default_branch
,
:string
,
:null
=>
false
,
:default
=>
"master"
end
end
db/schema.rb
View file @
3d7ee4bf
...
...
@@ -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,6 +76,6 @@
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"
...
...
@@ -80,5 +80,6 @@
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
View file @
3d7ee4bf
...
...
@@ -42,7 +42,7 @@
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
...
...
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