From e5507fdd74c19345bd91eea5b5b56a83351db8d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20D=C3=A1vila?= Date: Wed, 30 Mar 2016 21:50:17 -0500 Subject: 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. --- lib/gitlab_projects.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb index 11a5a16..0193a18 100644 --- a/lib/gitlab_projects.rb +++ b/lib/gitlab_projects.rb @@ -180,11 +180,15 @@ class GitlabProjects timeout = (ARGV.shift || 120).to_i # 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}." - cmd = %W(git --git-dir=#{full_path} fetch #{@name} --tags) + cmd = %W(git --git-dir=#{full_path} fetch #{@name}) cmd << '--force' if forced + cmd << tags_option pid = Process.spawn(*cmd) begin -- cgit v1.2.1