Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/rbs/collection/sources/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ def to_lockfile
# git v2.27.0 or greater
git 'clone', '--filter=blob:none', remote, git_dir.to_s, chdir: nil
rescue CommandError
# The failed `--filter=blob:none` clone may leave behind a
# partial repository (e.g. when the server returned an error
# mid-clone), which would cause the fallback `git clone` to
# fail with "destination path ... already exists and is not
# an empty directory". Clean it up before retrying.
FileUtils.rm_rf(git_dir)
git 'clone', remote, git_dir.to_s, chdir: nil
end
end
Expand Down
Loading