Skip to content

Commit

Permalink
Adds 'pack 1 unresolved delta' to the list of failure modes
Browse files Browse the repository at this point in the history
  • Loading branch information
congt committed Sep 16, 2020
1 parent c991ff8 commit 7d8a6fa
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
git-fastclone (1.2.5)
git-fastclone (1.2.6)
colorize
terrapin (~> 0.6.0)

Expand Down
2 changes: 1 addition & 1 deletion lib/git-fastclone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def with_git_mirror(url)
'fatal: missing blob object',
'fatal: remote did not send all necessary objects',
/fatal: packed object [a-z0-9]+ \(stored in .*?\) is corrupt/,
/fatal: pack has \d+ unresolved deltas/,
/fatal: pack has \d+ unresolved delta/,
'error: unable to read sha1 file of ',
'fatal: did not receive expected object'
]
Expand Down
2 changes: 1 addition & 1 deletion lib/git-fastclone/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

# Version string for git-fastclone
module GitFastCloneVersion
VERSION = '1.2.5'.freeze
VERSION = '1.2.6'.freeze
end
27 changes: 27 additions & 0 deletions spec/git_fastclone_runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,33 @@
expect(yielded).to eq([test_url_valid])
end

it 'should retry when one delta is missing' do
allow(subject).to receive(:update_reference_repo) {}
expect(subject).to receive(:reference_repo_dir)
expect(subject).to receive(:reference_repo_lock_file).and_return(lockfile)

responses = [
lambda { |_url|
raise Terrapin::ExitStatusError, <<-ERROR.gsub(/^ {12}/, '')
STDOUT:
STDERR:
error: Could not read f7fad86d06fee0678f9af7203b6031feabb40c3e
fatal: pack has 1 unresolved delta
fatal: index-pack failed
ERROR
},
->(url) { url }
]
subject.with_git_mirror(test_url_valid) do
yielded << responses.shift.call(test_url_valid)
end

expect(responses).to be_empty
expect(yielded).to eq([test_url_valid])
end

it 'should retry when deltas are missing' do
allow(subject).to receive(:update_reference_repo) {}
expect(subject).to receive(:reference_repo_dir)
Expand Down

0 comments on commit 7d8a6fa

Please sign in to comment.