git-fastclone 1.2.2 → 1.2.3
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 +1 -0
- data/lib/git-fastclone/version.rb +1 -1
- data/spec/git_fastclone_runner_spec.rb +27 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35118c0d971e4f97e889723386ad30de71ebc426dee6a1302578ad4ea21ed869
|
4
|
+
data.tar.gz: 6b66bf1d46e74b219e40b2fb88bb9e6f348edb5e5342704449fa06726a1d0b1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0157f54b9b9add66469acbd07859884b02b020887d589c56bcc92267c63eff6bddeba90b7a1ff1486ae6da9341602c439e2f00bf885aa7e7634929ad7ee3ec3
|
7
|
+
data.tar.gz: 15d09bc6008f1aa851f6b3192c9eaf88fbf40b0000b51c235172601ea489d8477f9bc1cd8142ab36e191c6496bda3057d6b0933f6f5f3e7e1109f3b0d8de8ab8
|
data/lib/git-fastclone.rb
CHANGED
@@ -355,6 +355,7 @@ module GitFastClone
|
|
355
355
|
error_strings = [
|
356
356
|
'missing blob object',
|
357
357
|
'remote did not send all necessary objects',
|
358
|
+
/packed object [a-z0-9]+ \(stored in .*?\) is corrupt/,
|
358
359
|
/pack has \d+ unresolved deltas/
|
359
360
|
]
|
360
361
|
if e.to_s =~ /^STDERR:\n.+^fatal: #{Regexp.union(error_strings)}/m
|
@@ -306,6 +306,33 @@ describe GitFastClone::Runner do
|
|
306
306
|
expect(yielded).to eq([test_url_valid])
|
307
307
|
end
|
308
308
|
|
309
|
+
it 'should retry when the clone succeeds but checkout fails' 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
|
+
fatal: packed object 7c4d79704f8adf701f38a7bfb3e33ec5342542f1 (stored in /private/var/tmp/git-fastclone/reference/some-repo.git/objects/pack/pack-d37d7ed3e88d6e5f0ac141a7b0a2b32baf6e21a0.pack) is corrupt
|
322
|
+
warning: Clone succeeded, but checkout failed.
|
323
|
+
You can inspect what was checked out with 'git status' and retry with 'git restore --source=HEAD :/'
|
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
|
335
|
+
|
309
336
|
it 'should retry when deltas are missing' do
|
310
337
|
allow(subject).to receive(:update_reference_repo) {}
|
311
338
|
expect(subject).to receive(:reference_repo_dir)
|
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.3
|
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-09-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|