Merge branch 'jt/unify-object-info'

Code clean-ups.

* jt/unify-object-info:
  sha1_file: refactor has_sha1_file_with_flags
  sha1_file: do not access pack if unneeded
  sha1_file: teach sha1_object_info_extended more flags
  sha1_file: refactor read_object
  sha1_file: move delta base cache code up
  sha1_file: rename LOOKUP_REPLACE_OBJECT
  sha1_file: rename LOOKUP_UNKNOWN_OBJECT
  sha1_file: teach packed_object_info about typename
This commit is contained in:
Junio C Hamano
2017-07-05 13:32:57 -07:00
5 changed files with 223 additions and 216 deletions

View File

@ -250,9 +250,11 @@ static void find_non_local_tags(struct transport *transport,
*/
if (ends_with(ref->name, "^{}")) {
if (item &&
!has_object_file_with_flags(&ref->old_oid, HAS_SHA1_QUICK) &&
!has_object_file_with_flags(&ref->old_oid,
OBJECT_INFO_QUICK) &&
!will_fetch(head, ref->old_oid.hash) &&
!has_sha1_file_with_flags(item->util, HAS_SHA1_QUICK) &&
!has_sha1_file_with_flags(item->util,
OBJECT_INFO_QUICK) &&
!will_fetch(head, item->util))
item->util = NULL;
item = NULL;
@ -266,7 +268,7 @@ static void find_non_local_tags(struct transport *transport,
* fetch.
*/
if (item &&
!has_sha1_file_with_flags(item->util, HAS_SHA1_QUICK) &&
!has_sha1_file_with_flags(item->util, OBJECT_INFO_QUICK) &&
!will_fetch(head, item->util))
item->util = NULL;
@ -287,7 +289,7 @@ static void find_non_local_tags(struct transport *transport,
* checked to see if it needs fetching.
*/
if (item &&
!has_sha1_file_with_flags(item->util, HAS_SHA1_QUICK) &&
!has_sha1_file_with_flags(item->util, OBJECT_INFO_QUICK) &&
!will_fetch(head, item->util))
item->util = NULL;