Skip to content
Snippets Groups Projects
Commit d2b77063 authored by Jeroen Nijhof's avatar Jeroen Nijhof
Browse files

Added git gc for housekeeping

parent fccdcc07
No related branches found
No related tags found
1 merge request!23Added git gc for housekeeping
Loading
Loading
@@ -121,6 +121,10 @@ Remove tag:
 
./bin/gitlab-projects rm-tag gitlab/gitlab-ci.git v3.0.0
 
Gc repo:
./bin/gitlab-projects gc gitlab/gitlab-ci.git
## Keys
 
Add key:
Loading
Loading
Loading
Loading
@@ -55,11 +55,12 @@ class GitlabProjects
when 'rm-tag'; rm_tag
when 'add-project'; add_project
when 'list-projects'; puts list_projects
when 'rm-project'; rm_project
when 'mv-project'; mv_project
when 'rm-project'; rm_project
when 'mv-project'; mv_project
when 'import-project'; import_project
when 'fork-project'; fork_project
when 'update-head'; update_head
when 'update-head'; update_head
when 'gc'; gc
else
$logger.warn "Attempt to execute invalid gitlab-projects command #{@command.inspect}."
puts 'not allowed'
Loading
Loading
@@ -246,4 +247,10 @@ class GitlabProjects
$logger.info "Update head in project #{project_name} to <#{new_head}>."
true
end
def gc
$logger.info "Running git gc for <#{full_path}>."
cmd = %W(git --git-dir=#{full_path} gc)
system(*cmd)
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment