@@ -337,7 +337,6 @@ static void find_non_local_tags(const struct ref *refs,
337337 struct string_list_item * remote_ref_item ;
338338 const struct ref * ref ;
339339 struct refname_hash_entry * item = NULL ;
340- const int quick_flags = OBJECT_INFO_QUICK | OBJECT_INFO_SKIP_FETCH_OBJECT ;
341340
342341 refname_hash_init (& existing_refs );
343342 refname_hash_init (& remote_refs );
@@ -367,9 +366,9 @@ static void find_non_local_tags(const struct ref *refs,
367366 */
368367 if (ends_with (ref -> name , "^{}" )) {
369368 if (item &&
370- !repo_has_object_file_with_flags (the_repository , & ref -> old_oid , quick_flags ) &&
369+ !has_object (the_repository , & ref -> old_oid , 0 ) &&
371370 !oidset_contains (& fetch_oids , & ref -> old_oid ) &&
372- !repo_has_object_file_with_flags (the_repository , & item -> oid , quick_flags ) &&
371+ !has_object (the_repository , & item -> oid , 0 ) &&
373372 !oidset_contains (& fetch_oids , & item -> oid ))
374373 clear_item (item );
375374 item = NULL ;
@@ -383,7 +382,7 @@ static void find_non_local_tags(const struct ref *refs,
383382 * fetch.
384383 */
385384 if (item &&
386- !repo_has_object_file_with_flags (the_repository , & item -> oid , quick_flags ) &&
385+ !has_object (the_repository , & item -> oid , 0 ) &&
387386 !oidset_contains (& fetch_oids , & item -> oid ))
388387 clear_item (item );
389388
@@ -404,7 +403,7 @@ static void find_non_local_tags(const struct ref *refs,
404403 * checked to see if it needs fetching.
405404 */
406405 if (item &&
407- !repo_has_object_file_with_flags (the_repository , & item -> oid , quick_flags ) &&
406+ !has_object (the_repository , & item -> oid , 0 ) &&
408407 !oidset_contains (& fetch_oids , & item -> oid ))
409408 clear_item (item );
410409
@@ -911,7 +910,8 @@ static int update_local_ref(struct ref *ref,
911910 struct commit * current = NULL , * updated ;
912911 int fast_forward = 0 ;
913912
914- if (!repo_has_object_file (the_repository , & ref -> new_oid ))
913+ if (!has_object (the_repository , & ref -> new_oid ,
914+ HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR ))
915915 die (_ ("object %s not found" ), oid_to_hex (& ref -> new_oid ));
916916
917917 if (oideq (& ref -> old_oid , & ref -> new_oid )) {
@@ -1330,8 +1330,7 @@ static int check_exist_and_connected(struct ref *ref_map)
13301330 * we need all direct targets to exist.
13311331 */
13321332 for (r = rm ; r ; r = r -> next ) {
1333- if (!repo_has_object_file_with_flags (the_repository , & r -> old_oid ,
1334- OBJECT_INFO_SKIP_FETCH_OBJECT ))
1333+ if (!has_object (the_repository , & r -> old_oid , HAS_OBJECT_RECHECK_PACKED ))
13351334 return -1 ;
13361335 }
13371336
0 commit comments