Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-shell
Commits
1f0a77ca
Commit
1f0a77ca
authored
Apr 15, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the update-head command since GitLab doesn't use it anymore
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
3f942ef5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 addition
and
50 deletions
+1
-50
CHANGELOG
CHANGELOG
+1
-0
README.md
README.md
+0
-4
bin/gitlab-projects
bin/gitlab-projects
+0
-2
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+0
-17
spec/gitlab_projects_spec.rb
spec/gitlab_projects_spec.rb
+0
-27
No files found.
CHANGELOG
View file @
1f0a77ca
...
...
@@ -2,6 +2,7 @@ v3.0.0
- Remove rm-tag command (Robert Schilling)
- Remove create-branch and rm-branch commands (Robert Schilling)
- Update PostReceive worker so it logs a unique JID in Sidekiq
- Remove update-head command
v2.7.2
- Do not prune objects during 'git gc'
...
...
README.md
View file @
1f0a77ca
...
...
@@ -100,10 +100,6 @@ Fork repo:
./bin/gitlab-projects fork-project gitlab/gitlab-ci.git randx
Update HEAD:
./bin/gitlab-projects update-head gitlab/gitlab-ci.git 3-2-stable
Create tag (lightweight & annotated):
./bin/gitlab-projects create-tag gitlab/gitlab-ci.git v3.0.0 3-0-stable
...
...
bin/gitlab-projects
View file @
1f0a77ca
...
...
@@ -19,8 +19,6 @@ require_relative '../lib/gitlab_init'
#
# /bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git
#
# /bin/gitlab-projects update-head gitlab/gitlab-ci.git 5-2-stable
#
require
File
.
join
(
ROOT_PATH
,
'lib'
,
'gitlab_projects'
)
# Return non-zero if command execution was not successful
...
...
lib/gitlab_projects.rb
View file @
1f0a77ca
...
...
@@ -58,7 +58,6 @@ class GitlabProjects
when
'import-project'
;
import_project
when
'fork-project'
;
fork_project
when
'fetch-remote'
;
fetch_remote
when
'update-head'
;
update_head
when
'push-branches'
;
push_branches
when
'delete-remote-branches'
;
delete_remote_branches
when
'list-remote-tags'
;
list_remote_tags
...
...
@@ -314,22 +313,6 @@ class GitlabProjects
system
(
*
cmd
)
&&
self
.
class
.
create_hooks
(
full_destination_path
)
end
def
update_head
new_head
=
ARGV
.
shift
unless
new_head
$logger
.
error
"update-head failed: no branch provided."
return
false
end
File
.
open
(
File
.
join
(
full_path
,
'HEAD'
),
'w'
)
do
|
f
|
f
.
write
(
"ref: refs/heads/
#{
new_head
}
"
)
end
$logger
.
info
"Update head in project
#{
project_name
}
to <
#{
new_head
}
>."
true
end
def
gc
$logger
.
info
"Running git gc for <
#{
full_path
}
>."
unless
File
.
exists?
(
full_path
)
...
...
spec/gitlab_projects_spec.rb
View file @
1f0a77ca
...
...
@@ -205,33 +205,6 @@ describe GitlabProjects do
end
end
describe
:update_head
do
let
(
:gl_projects
)
{
build_gitlab_projects
(
'update-head'
,
repo_name
,
'stable'
)
}
let
(
:gl_projects_fail
)
{
build_gitlab_projects
'update-head'
,
repo_name
}
before
do
FileUtils
.
mkdir_p
(
tmp_repo_path
)
system
(
*
%W(git init --bare
#{
tmp_repo_path
}
)
)
FileUtils
.
touch
(
File
.
join
(
tmp_repo_path
,
"refs/heads/stable"
))
File
.
read
(
File
.
join
(
tmp_repo_path
,
'HEAD'
)).
strip
.
should
==
'ref: refs/heads/master'
end
it
"should update head for repo"
do
gl_projects
.
exec
.
should
be_true
File
.
read
(
File
.
join
(
tmp_repo_path
,
'HEAD'
)).
strip
.
should
==
'ref: refs/heads/stable'
end
it
"should log an update_head event"
do
$logger
.
should_receive
(
:info
).
with
(
"Update head in project
#{
repo_name
}
to <stable>."
)
gl_projects
.
exec
end
it
"should failed and log an error"
do
$logger
.
should_receive
(
:error
).
with
(
"update-head failed: no branch provided."
)
gl_projects_fail
.
exec
.
should
be_false
end
end
describe
:import_project
do
context
'success import'
do
let
(
:gl_projects
)
{
build_gitlab_projects
(
'import-project'
,
repo_name
,
'https://github.com/randx/six.git'
)
}
...
...
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