File tree Expand file tree Collapse file tree 5 files changed +36
-3
lines changed Expand file tree Collapse file tree 5 files changed +36
-3
lines changed Original file line number Diff line number Diff line change @@ -4,3 +4,7 @@ language:
44rvm :
55 - 2.3.1
66 - 2.6.1
7+
8+ before_install :
9+ - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
10+ - gem install bundler -v '< 2.0'
Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- git-fastclone (1.2.4 )
4+ git-fastclone (1.2.5 )
55 colorize
66 terrapin (~> 0.6.0 )
77
Original file line number Diff line number Diff line change @@ -357,7 +357,8 @@ def with_git_mirror(url)
357357 'fatal: remote did not send all necessary objects' ,
358358 /fatal: packed object [a-z0-9]+ \( stored in .*?\) is corrupt/ ,
359359 /fatal: pack has \d + unresolved deltas/ ,
360- 'error: unable to read sha1 file of '
360+ 'error: unable to read sha1 file of ' ,
361+ 'fatal: did not receive expected object'
361362 ]
362363 if e . to_s =~ /^STDERR:\n .+^#{ Regexp . union ( error_strings ) } /m
363364 # To avoid corruption of the cache, if we failed to update or check out we remove
Original file line number Diff line number Diff line change 22
33# Version string for git-fastclone
44module GitFastCloneVersion
5- VERSION = '1.2.4 ' . freeze
5+ VERSION = '1.2.5 ' . freeze
66end
Original file line number Diff line number Diff line change 389389 expect ( responses ) . to be_empty
390390 expect ( yielded ) . to eq ( [ test_url_valid ] )
391391 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
392420end
You can’t perform that action at this time.
0 commit comments