File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -469,8 +469,19 @@ static int open_packed_git_1(struct packed_git *p)
469469 ssize_t read_result ;
470470 const unsigned hashsz = the_hash_algo -> rawsz ;
471471
472- if (!p -> index_data && open_pack_index (p ))
473- return error ("packfile %s index unavailable" , p -> pack_name );
472+ if (!p -> index_data ) {
473+ struct multi_pack_index * m ;
474+ const char * pack_name = strrchr (p -> pack_name , '/' );
475+
476+ for (m = the_repository -> objects -> multi_pack_index ;
477+ m ; m = m -> next ) {
478+ if (midx_contains_pack (m , pack_name ))
479+ break ;
480+ }
481+
482+ if (!m && open_pack_index (p ))
483+ return error ("packfile %s index unavailable" , p -> pack_name );
484+ }
474485
475486 if (!pack_max_fds ) {
476487 unsigned int max_fds = get_max_fd_limit ();
@@ -521,6 +532,10 @@ static int open_packed_git_1(struct packed_git *p)
521532 " supported (try upgrading GIT to a newer version)" ,
522533 p -> pack_name , ntohl (hdr .hdr_version ));
523534
535+ /* Skip index checking if in multi-pack-index */
536+ if (!p -> index_data )
537+ return 0 ;
538+
524539 /* Verify the pack matches its index. */
525540 if (p -> num_objects != ntohl (hdr .hdr_entries ))
526541 return error ("packfile %s claims to have %" PRIu32 " objects"
You can’t perform that action at this time.
0 commit comments