Skip to content
Snippets Groups Projects
Commit 82b3a4e8 authored by Douwe Maan's avatar Douwe Maan
Browse files

Merge branch 'master' into 'master'

Added git gc for housekeeping

This merge request will add the gc functionality used by the housekeeping function in the project settings page.

see gitlab-org/gitlab-ce#3041 and https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/1658

See merge request !23
parents 962f7a31 6632bd27
No related branches found
No related tags found
No related merge requests found
Pipeline #
v2.6.10
- Add git gc for housekeeping
v2.6.9 v2.6.9
- Remove trailing slashes from gitlab_url - Remove trailing slashes from gitlab_url
   
Loading
Loading
Loading
@@ -121,6 +121,10 @@ Remove tag:
Loading
@@ -121,6 +121,10 @@ Remove tag:
   
./bin/gitlab-projects rm-tag gitlab/gitlab-ci.git v3.0.0 ./bin/gitlab-projects rm-tag gitlab/gitlab-ci.git v3.0.0
   
Gc repo:
./bin/gitlab-projects gc gitlab/gitlab-ci.git
## Keys ## Keys
   
Add key: Add key:
Loading
Loading
2.6.9 2.6.10
Loading
@@ -61,6 +61,7 @@ class GitlabProjects
Loading
@@ -61,6 +61,7 @@ class GitlabProjects
when 'fork-project'; fork_project when 'fork-project'; fork_project
when 'fetch-remote'; fetch_remote when 'fetch-remote'; fetch_remote
when 'update-head'; update_head when 'update-head'; update_head
when 'gc'; gc
else else
$logger.warn "Attempt to execute invalid gitlab-projects command #{@command.inspect}." $logger.warn "Attempt to execute invalid gitlab-projects command #{@command.inspect}."
puts 'not allowed' puts 'not allowed'
Loading
@@ -275,4 +276,14 @@ class GitlabProjects
Loading
@@ -275,4 +276,14 @@ class GitlabProjects
$logger.info "Update head in project #{project_name} to <#{new_head}>." $logger.info "Update head in project #{project_name} to <#{new_head}>."
true true
end end
def gc
$logger.info "Running git gc for <#{full_path}>."
unless File.exists?(full_path)
$logger.error "gc failed: destination path <#{full_path}> does not exist."
return false
end
cmd = %W(git --git-dir=#{full_path} gc)
system(*cmd)
end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment