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
Boxiang Sun
gitlab-ce
Commits
d68ec5e0
Commit
d68ec5e0
authored
Dec 07, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
default_branch for project & fixed project destroy
parent
2552a877
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
6 deletions
+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
No files found.
app/controllers/application_controller.rb
View file @
d68ec5e0
...
@@ -61,7 +61,7 @@ class ApplicationController < ActionController::Base
...
@@ -61,7 +61,7 @@ class ApplicationController < ActionController::Base
else
else
@branch
=
params
[
:branch
].
blank?
?
nil
:
params
[
:branch
]
@branch
=
params
[
:branch
].
blank?
?
nil
:
params
[
:branch
]
@tag
=
params
[
:tag
].
blank?
?
nil
:
params
[
:tag
]
@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
end
end
...
...
app/models/project.rb
View file @
d68ec5e0
...
@@ -158,7 +158,7 @@ class Project < ActiveRecord::Base
...
@@ -158,7 +158,7 @@ class Project < ActiveRecord::Base
end
end
def
root_ref
def
root_ref
"master"
default_branch
||
"master"
end
end
def
public?
def
public?
...
...
app/views/layouts/project.html.haml
View file @
d68ec5e0
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
%span
{
:class
=>
"number"
}=
@project
.
snippets
.
non_expired
.
count
%span
{
:class
=>
"number"
}=
@project
.
snippets
.
non_expired
.
count
-
if
can?
current_user
,
:admin_project
,
@project
-
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
.medium-tags
{
:style
=>
'padding: 10px 0 0 10px; width: 210px;'
}=
tag_list
@project
...
...
app/views/projects/_form.html.haml
View file @
d68ec5e0
...
@@ -29,6 +29,11 @@
...
@@ -29,6 +29,11 @@
%cite
.right
=
"http://
#{
GIT_HOST
[
"host"
]
}
/"
%cite
.right
=
"http://
#{
GIT_HOST
[
"host"
]
}
/"
%td
=
f
.
text_field
:code
,
:placeholder
=>
"example"
%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
%tr
%td
=
f
.
label
:tag_list
%td
=
f
.
label
:tag_list
%td
=
f
.
text_area
:tag_list
,
:placeholder
=>
"project tags"
,
:style
=>
"height:50px"
,
:id
=>
:tag_field
%td
=
f
.
text_area
:tag_list
,
:placeholder
=>
"project tags"
,
:style
=>
"height:50px"
,
:id
=>
:tag_field
...
@@ -57,4 +62,5 @@
...
@@ -57,4 +62,5 @@
:javascript
:javascript
$
(
function
(){
$
(
function
(){
taggifyForm
();
taggifyForm
();
$
(
'
form #project_default_branch
'
).
chosen
();
})
})
db/migrate/20111207211728_add_default_branch_to_project.rb
0 → 100644
View file @
d68ec5e0
class
AddDefaultBranchToProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:default_branch
,
:string
,
:null
=>
false
,
:default
=>
"master"
end
end
db/schema.rb
View file @
d68ec5e0
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
# It's strongly recommended to check this file into your version control system.
# 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
|
create_table
"features"
,
:force
=>
true
do
|
t
|
t
.
string
"name"
t
.
string
"name"
...
@@ -76,9 +76,10 @@ ActiveRecord::Schema.define(:version => 20111206222316) do
...
@@ -76,9 +76,10 @@ ActiveRecord::Schema.define(:version => 20111206222316) do
t
.
text
"description"
t
.
text
"description"
t
.
datetime
"created_at"
t
.
datetime
"created_at"
t
.
datetime
"updated_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
.
string
"code"
t
.
integer
"owner_id"
t
.
integer
"owner_id"
t
.
string
"default_branch"
,
:default
=>
"master"
,
:null
=>
false
end
end
create_table
"snippets"
,
:force
=>
true
do
|
t
|
create_table
"snippets"
,
:force
=>
true
do
|
t
|
...
...
lib/gitlabhq/gitolite.rb
View file @
d68ec5e0
...
@@ -42,7 +42,7 @@ module Gitlabhq
...
@@ -42,7 +42,7 @@ module Gitlabhq
end
end
def
destroy_project
(
project
)
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'
))
ga_repo
=
::
Gitolite
::
GitoliteAdmin
.
new
(
File
.
join
(
@local_dir
,
'gitolite'
))
conf
=
ga_repo
.
config
conf
=
ga_repo
.
config
...
...
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