git-fastclone 1.2.1 → 1.2.2
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.
- checksums.yaml +4 -4
- data/lib/git-fastclone.rb +6 -1
- data/lib/git-fastclone/version.rb +1 -1
- data/spec/git_fastclone_runner_spec.rb +27 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8e50fa1e33c6aaf524cd7d9860010d7826c1c110b35cbbf7e35006b8d0f04ec
|
4
|
+
data.tar.gz: 3b5e733a76ba36cb3e8b851600094995247841f9c5655208347a47daefcd5eb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20d61371e4348ae34919dfa236f13413653f433908d941a9987d8404d9b177c9bb7b72209ce5c609f5b24e09949e4ec69858f30040a7b7c9da8e6d56d9f80c42
|
7
|
+
data.tar.gz: ce65442150e9ef8c5fe35b5c6f0d1c3e7430cd6cf128a06e0166de971c215b194475b080a698f33a29eccf84c0ad2f9afcf57f16a0d2de45424502399914ef90
|
data/lib/git-fastclone.rb
CHANGED
@@ -352,7 +352,12 @@ module GitFastClone
|
|
352
352
|
begin
|
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
|
+
/pack has \d+ unresolved deltas/
|
359
|
+
]
|
360
|
+
if e.to_s =~ /^STDERR:\n.+^fatal: #{Regexp.union(error_strings)}/m
|
356
361
|
# To avoid corruption of the cache, if we failed to update or check out we remove
|
357
362
|
# the cache directory entirely. This may cause the current clone to fail, but if the
|
358
363
|
# underlying error from git is transient it will not affect future clones.
|
@@ -305,5 +305,32 @@ describe GitFastClone::Runner do
|
|
305
305
|
expect(responses).to be_empty
|
306
306
|
expect(yielded).to eq([test_url_valid])
|
307
307
|
end
|
308
|
+
|
309
|
+
it 'should retry when deltas are missing' do
|
310
|
+
allow(subject).to receive(:update_reference_repo) {}
|
311
|
+
expect(subject).to receive(:reference_repo_dir)
|
312
|
+
expect(subject).to receive(:reference_repo_lock_file).and_return(lockfile)
|
313
|
+
|
314
|
+
responses = [
|
315
|
+
lambda { |_url|
|
316
|
+
raise Terrapin::ExitStatusError, <<-ERROR.gsub(/^ {12}/, '')
|
317
|
+
STDOUT:
|
318
|
+
|
319
|
+
STDERR:
|
320
|
+
|
321
|
+
error: Could not read f7fad86d06fee0678f9af7203b6031feabb40c3e
|
322
|
+
fatal: pack has 138063 unresolved deltas
|
323
|
+
fatal: index-pack failed
|
324
|
+
ERROR
|
325
|
+
},
|
326
|
+
->(url) { url }
|
327
|
+
]
|
328
|
+
subject.with_git_mirror(test_url_valid) do
|
329
|
+
yielded << responses.shift.call(test_url_valid)
|
330
|
+
end
|
331
|
+
|
332
|
+
expect(responses).to be_empty
|
333
|
+
expect(yielded).to eq([test_url_valid])
|
334
|
+
end
|
308
335
|
end
|
309
336
|
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.
|
4
|
+
version: 1.2.2
|
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-
|
12
|
+
date: 2019-08-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|
@@ -77,7 +77,7 @@ 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.
|
80
|
+
rubygems_version: 3.0.4
|
81
81
|
signing_key:
|
82
82
|
specification_version: 4
|
83
83
|
summary: git-clone --recursive on steroids!
|