File tree Expand file tree Collapse file tree
bundler/lib/bundler/compact_index_client
spec/bundler/compact_index_client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,7 +71,10 @@ def gem_parser
7171 # This method gets called at least once for every gem when parsing versions.
7272 def parse_version_checksum ( line , checksums )
7373 return unless ( name_end = line . index ( " " ) ) # Artifactory bug causes blank lines in artifactor index files
74- return unless ( checksum_start = line . index ( " " , name_end + 1 ) + 1 )
74+ checksum_start = line . index ( " " , name_end + 1 )
75+ return unless checksum_start
76+ checksum_start += 1
77+
7578 checksum_end = line . size - checksum_start
7679
7780 line . freeze # allows slicing into the string to not allocate a copy of the line
Original file line number Diff line number Diff line change @@ -233,5 +233,17 @@ def set_info_data(name, value)
233233 VERSIONS
234234 expect ( parser . info ( "a" ) ) . to eq ( a_result )
235235 end
236+
237+ it "handles lines without a checksum" do
238+ compact_index . versions = <<~VERSIONS
239+ created_at: 2024-05-01T00:00:04Z
240+ ---
241+ a 1.0.0,1.0.1,1.1.0 aaa111
242+ b 2.0.0,2.0.0-java
243+ c 3.0.0,3.0.3,3.3.3 ccc333
244+ VERSIONS
245+
246+ expect ( parser . info ( "a" ) ) . to eq ( a_result )
247+ end
236248 end
237249end
You can’t perform that action at this time.
0 commit comments