right_scraper 1.0.17 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -52,8 +52,9 @@ module RightScale
52
52
  has_tag = !@repo.tag.nil? && !@repo.tag.empty?
53
53
 
54
54
  if @incremental
55
+ checkout = false
55
56
  Dir.chdir(@current_repo_dir) do
56
- git_fetch(:depth => 1)
57
+ git_fetch(:depth => 1, :remote_tag => @repo.tag)
57
58
  if succeeded? && @incremental && has_tag
58
59
  analysis = analyze_repo_tag
59
60
  if succeeded?
@@ -75,12 +76,12 @@ module RightScale
75
76
  end
76
77
  end
77
78
  end
78
- if succeeded?
79
- if checkout || is_branch && !on_branch
80
- git_checkout(@repo.tag)
81
- else # Pull latest commits on same branch
82
- git_fetch(:merge => true, :remote_tag => @repo.tag)
83
- end
79
+ end
80
+ if succeeded?
81
+ if checkout || is_branch && !on_branch
82
+ git_checkout(@repo.tag)
83
+ else # Pull latest commits on same branch
84
+ git_fetch(:depth => 1, :merge => true, :remote_tag => @repo.tag)
84
85
  end
85
86
  end
86
87
  end
@@ -212,11 +213,12 @@ module RightScale
212
213
  # true:: Always return true
213
214
  def git_fetch(opts={})
214
215
  depth = opts[:depth] || 2**31 - 1 # Specify max to override depth of already cloned repo
215
- remote = opts[:remote_tag] || 'master'
216
+ remote = opts[:remote_tag]
217
+ remote = 'master' if remote.nil? || remote.rstrip.empty?
216
218
  action = (opts[:merge] ? 'pull' : 'fetch')
217
219
  git_cmd = "#{@ssh_cmd} git #{action} --tags --depth #{depth} origin #{remote} 2>&1"
218
220
  res = @watcher.launch_and_watch(git_cmd, @current_repo_dir)
219
- handle_watcher_result(res, "git #{action}", ok_codes=[0, 1]) # git fetch returns 1 when there is nothing to fetch
221
+ handle_watcher_result(res, "git #{action}")
220
222
  end
221
223
 
222
224
  # Does a git checkout to given tag
@@ -23,7 +23,7 @@ require 'rubygems'
23
23
 
24
24
  spec = Gem::Specification.new do |spec|
25
25
  spec.name = 'right_scraper'
26
- spec.version = '1.0.17'
26
+ spec.version = '1.0.18'
27
27
  spec.authors = ['Raphael Simon']
28
28
  spec.email = 'raphael@rightscale.com'
29
29
  spec.homepage = 'https://github.com/rightscale/right_scraper'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.17
4
+ version: 1.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raphael Simon
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-05-11 00:00:00 -07:00
12
+ date: 2010-06-03 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15