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
fba8ad56
Commit
fba8ad56
authored
Oct 26, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Gitlab::Satellite into the Satellite module
parent
5f166878
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
41 deletions
+42
-41
app/roles/repository.rb
app/roles/repository.rb
+1
-1
lib/gitlab/satellite.rb
lib/gitlab/satellite.rb
+0
-40
lib/gitlab/satellite/satellite.rb
lib/gitlab/satellite/satellite.rb
+41
-0
No files found.
app/roles/repository.rb
View file @
fba8ad56
...
@@ -41,7 +41,7 @@ module Repository
...
@@ -41,7 +41,7 @@ module Repository
end
end
def
satellite
def
satellite
@satellite
||=
Gitlab
::
Satellite
.
new
(
self
)
@satellite
||=
Gitlab
::
Satellite
::
Satellite
.
new
(
self
)
end
end
def
has_post_receive_file?
def
has_post_receive_file?
...
...
lib/gitlab/satellite.rb
deleted
100644 → 0
View file @
5f166878
module
Gitlab
class
Satellite
PARKING_BRANCH
=
"__parking_branch"
attr_accessor
:project
def
initialize
(
project
)
@project
=
project
end
#will be deleted all branches except PARKING_BRANCH
def
clear
Dir
.
chdir
(
path
)
do
heads
=
Grit
::
Repo
.
new
(
"."
).
heads
.
map
{
|
head
|
head
.
name
}
if
heads
.
include?
PARKING_BRANCH
`git checkout
#{
PARKING_BRANCH
}
`
else
`git checkout -b
#{
PARKING_BRANCH
}
`
end
heads
.
delete
(
PARKING_BRANCH
)
heads
.
each
do
|
head
|
`git branch -D
#{
head
}
`
end
end
end
def
create
`git clone
#{
project
.
url_to_repo
}
#{
path
}
`
end
def
exists?
File
.
exists?
path
end
def
path
Rails
.
root
.
join
(
"tmp"
,
"repo_satellites"
,
project
.
path
)
end
end
end
lib/gitlab/satellite/satellite.rb
0 → 100644
View file @
fba8ad56
module
Gitlab
module
Satellite
class
Satellite
PARKING_BRANCH
=
"__parking_branch"
attr_accessor
:project
def
initialize
(
project
)
@project
=
project
end
#will be deleted all branches except PARKING_BRANCH
def
clear
Dir
.
chdir
(
path
)
do
heads
=
Grit
::
Repo
.
new
(
"."
).
heads
.
map
{
|
head
|
head
.
name
}
if
heads
.
include?
PARKING_BRANCH
`git checkout
#{
PARKING_BRANCH
}
`
else
`git checkout -b
#{
PARKING_BRANCH
}
`
end
heads
.
delete
(
PARKING_BRANCH
)
heads
.
each
do
|
head
|
`git branch -D
#{
head
}
`
end
end
end
def
create
`git clone
#{
project
.
url_to_repo
}
#{
path
}
`
end
def
exists?
File
.
exists?
path
end
def
path
Rails
.
root
.
join
(
"tmp"
,
"repo_satellites"
,
project
.
path
)
end
end
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