Commit e3dd612a authored by Patrick Steinhardt's avatar Patrick Steinhardt

gitaly_client: Allow BlobsStitcher to process blobs with no mode or path

The BlobsStitcher object will reassemble blobs which have been split up
across multiple gRPC messages. It is only used in the context of the
`get_blobs()` RPC right now, which has a bunch of information about
blobs which may not be available via other RPCs. While the stitcher
gracefully handles absence for many of the parameters, absence of a blob
mode and path will cause failure.

Relaxe the stitcher to work alright in case either mode or path are
absent. This is in preparation for the introduction of the
`list_blobs()` RPC.
parent a2a1ef06
......@@ -35,8 +35,8 @@ module Gitlab
Gitlab::Git::Blob.new(
id: blob_data[:oid],
mode: blob_data[:mode].to_s(8),
name: File.basename(blob_data[:path]),
mode: blob_data[:mode]&.to_s(8),
name: blob_data[:path] && File.basename(blob_data[:path]),
path: blob_data[:path],
size: blob_data[:size],
commit_id: blob_data[:revision],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment