MCPcopy Index your code
hub / github.com/git/git / everything_local

Function everything_local

fetch-pack.c:871–893  ·  view source on GitHub ↗

* Returns 1 if every object pointed to by the given remote refs is available * locally and reachable from a local ref, and 0 otherwise. */

Source from the content-addressed store, hash-verified

869 * locally and reachable from a local ref, and 0 otherwise.
870 */
871static int everything_local(struct fetch_pack_args *args,
872 struct ref **refs)
873{
874 struct ref *ref;
875 int retval;
876
877 for (retval = 1, ref = *refs; ref ; ref = ref->next) {
878 const struct object_id *remote = &ref->old_oid;
879 struct object *o;
880
881 o = lookup_object(the_repository, remote);
882 if (!o || !(o->flags & COMPLETE)) {
883 retval = 0;
884 print_verbose(args, "want %s (%s)", oid_to_hex(remote),
885 ref->name);
886 continue;
887 }
888 print_verbose(args, _("already have %s (%s)"), oid_to_hex(remote),
889 ref->name);
890 }
891
892 return retval;
893}
894
895static int sideband_demux(int in UNUSED, int out, void *data)
896{

Callers 2

do_fetch_packFunction · 0.85
do_fetch_pack_v2Function · 0.85

Calls 3

lookup_objectFunction · 0.85
print_verboseFunction · 0.85
oid_to_hexFunction · 0.85

Tested by

no test coverage detected