git-fastclone 1.2.3 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35118c0d971e4f97e889723386ad30de71ebc426dee6a1302578ad4ea21ed869
4
- data.tar.gz: 6b66bf1d46e74b219e40b2fb88bb9e6f348edb5e5342704449fa06726a1d0b1b
3
+ metadata.gz: 163da1441ec081e545dba9b3fa54832c20307e7936f38cefb4df3e9ad9515887
4
+ data.tar.gz: 348f6449e1e7da1d8a66bfedf820832572852e03729788a37418dfef3df86848
5
5
  SHA512:
6
- metadata.gz: f0157f54b9b9add66469acbd07859884b02b020887d589c56bcc92267c63eff6bddeba90b7a1ff1486ae6da9341602c439e2f00bf885aa7e7634929ad7ee3ec3
7
- data.tar.gz: 15d09bc6008f1aa851f6b3192c9eaf88fbf40b0000b51c235172601ea489d8477f9bc1cd8142ab36e191c6496bda3057d6b0933f6f5f3e7e1109f3b0d8de8ab8
6
+ metadata.gz: cd539f1544cbaa0d4d02b8657733b71b33683a994202e5e3f66e3a4ccd07a3ab34655c2d3f5764da1cca880722708688aba29333618a39c10c4873f3c67a9dcb
7
+ data.tar.gz: 5348e5a19d5d7bf863673952e1da137b1d65deac68ba8b76c6da4d190be53a244e776b208eecc248e2b018f88575e457137ad78670ea67cdfd5e97d65b35f3ab
@@ -353,12 +353,14 @@ module GitFastClone
353
353
  yield dir
354
354
  rescue Terrapin::ExitStatusError => e
355
355
  error_strings = [
356
- 'missing blob object',
357
- 'remote did not send all necessary objects',
358
- /packed object [a-z0-9]+ \(stored in .*?\) is corrupt/,
359
- /pack has \d+ unresolved deltas/
356
+ 'fatal: missing blob object',
357
+ 'fatal: remote did not send all necessary objects',
358
+ /fatal: packed object [a-z0-9]+ \(stored in .*?\) is corrupt/,
359
+ /fatal: pack has \d+ unresolved deltas/,
360
+ 'error: unable to read sha1 file of ',
361
+ 'fatal: did not receive expected object'
360
362
  ]
361
- if e.to_s =~ /^STDERR:\n.+^fatal: #{Regexp.union(error_strings)}/m
363
+ if e.to_s =~ /^STDERR:\n.+^#{Regexp.union(error_strings)}/m
362
364
  # To avoid corruption of the cache, if we failed to update or check out we remove
363
365
  # the cache directory entirely. This may cause the current clone to fail, but if the
364
366
  # underlying error from git is transient it will not affect future clones.
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Version string for git-fastclone
4
4
  module GitFastCloneVersion
5
- VERSION = '1.2.3'.freeze
5
+ VERSION = '1.2.5'.freeze
6
6
  end
@@ -360,4 +360,61 @@ describe GitFastClone::Runner do
360
360
  expect(yielded).to eq([test_url_valid])
361
361
  end
362
362
  end
363
+
364
+ it 'should retry when the cache errors with unable to read sha1 file' do
365
+ allow(subject).to receive(:update_reference_repo) {}
366
+ expect(subject).to receive(:reference_repo_dir)
367
+ expect(subject).to receive(:reference_repo_lock_file).and_return(lockfile)
368
+
369
+ responses = [
370
+ lambda { |_url|
371
+ raise Terrapin::ExitStatusError, <<-ERROR.gsub(/^ {12}/, '')
372
+ STDOUT:
373
+
374
+ STDERR:
375
+
376
+ error: unable to read sha1 file of sqiosbuild/lib/action/action.rb (6113b739af82d8b07731de8a58d6e233301f80ab)
377
+ fatal: unable to checkout working tree
378
+ warning: Clone succeeded, but checkout failed.
379
+ You can inspect what was checked out with 'git status'
380
+ and retry with 'git restore --source=HEAD :/'
381
+ ERROR
382
+ },
383
+ ->(url) { url }
384
+ ]
385
+ subject.with_git_mirror(test_url_valid) do
386
+ yielded << responses.shift.call(test_url_valid)
387
+ end
388
+
389
+ expect(responses).to be_empty
390
+ expect(yielded).to eq([test_url_valid])
391
+ end
392
+
393
+ it 'should retry when the cache errors with did not receive expected object' do
394
+ allow(subject).to receive(:update_reference_repo) {}
395
+ expect(subject).to receive(:reference_repo_dir)
396
+ expect(subject).to receive(:reference_repo_lock_file).and_return(lockfile)
397
+
398
+ responses = [
399
+ lambda { |_url|
400
+ raise Terrapin::ExitStatusError, <<-ERROR.gsub(/^ {12}/, '')
401
+ STDOUT:
402
+
403
+ STDERR:
404
+
405
+ error: Could not read 6682dfe81f66656436e60883dd795e7ec6735153
406
+ error: Could not read 0cd3703c23fa44c0043d97fbc26356a23939f31b
407
+ fatal: did not receive expected object 3c64c9dd49c79bd09aa13d4b05ac18263ca29ccd
408
+ fatal: index-pack failed
409
+ ERROR
410
+ },
411
+ ->(url) { url }
412
+ ]
413
+ subject.with_git_mirror(test_url_valid) do
414
+ yielded << responses.shift.call(test_url_valid)
415
+ end
416
+
417
+ expect(responses).to be_empty
418
+ expect(yielded).to eq([test_url_valid])
419
+ end
363
420
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-fastclone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Tauraso
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-09-19 00:00:00.000000000 Z
12
+ date: 2020-06-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize
@@ -77,7 +77,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0'
79
79
  requirements: []
80
- rubygems_version: 3.0.4
80
+ rubyforge_project:
81
+ rubygems_version: 2.7.7
81
82
  signing_key:
82
83
  specification_version: 4
83
84
  summary: git-clone --recursive on steroids!