Commit e5507fdd authored by Rubén Dávila's avatar Rubén Dávila

Add the ability to fetch remote repo without tags.

When fetching remote repo with tags the new remote tags are mixed in
with the local tags (all tags are saved under refs/tags), this affects
the UI of the Project given that we're showing up tags of a remote repo.
parent 3efa55dc
...@@ -180,11 +180,15 @@ class GitlabProjects ...@@ -180,11 +180,15 @@ class GitlabProjects
timeout = (ARGV.shift || 120).to_i timeout = (ARGV.shift || 120).to_i
# fetch with --force ? # fetch with --force ?
forced = (ARGV.shift == '--force') forced = ARGV.include?('--force')
# fetch with --tags or --no-tags
tags_option = ARGV.include?('--no-tags') ? '--no-tags' : '--tags'
$logger.info "Fetching remote #{@name} for project #{@project_name}." $logger.info "Fetching remote #{@name} for project #{@project_name}."
cmd = %W(git --git-dir=#{full_path} fetch #{@name} --tags) cmd = %W(git --git-dir=#{full_path} fetch #{@name})
cmd << '--force' if forced cmd << '--force' if forced
cmd << tags_option
pid = Process.spawn(*cmd) pid = Process.spawn(*cmd)
begin begin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment