summaryrefslogtreecommitdiff
path: root/lib/gitlab_projects.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-03-31 15:58:36 +0000
committerDouwe Maan <douwe@gitlab.com>2016-03-31 15:58:36 +0000
commitf4f4b419bbc5ba29754d0a6cc9c8540cc7879e2f (patch)
treef81a59916b7cd2d79988e93a1ca4fad8f2a89510 /lib/gitlab_projects.rb
parent3efa55dc759a3c126b0632bc451de1a138d63038 (diff)
parente5507fdd74c19345bd91eea5b5b56a83351db8d4 (diff)
downloadgitlab-shell-f4f4b419bbc5ba29754d0a6cc9c8540cc7879e2f.tar.gz
Merge branch 'gl_ee_issue_116' into 'master'
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. REF: https://gitlab.com/gitlab-org/gitlab-ee/issues/116 See merge request !46
Diffstat (limited to 'lib/gitlab_projects.rb')
-rw-r--r--lib/gitlab_projects.rb8
1 files changed, 6 insertions, 2 deletions
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