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

Function apply_cas

remote.c:2818–2852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2816}
2817
2818static void apply_cas(struct push_cas_option *cas,
2819 struct remote *remote,
2820 struct ref *ref)
2821{
2822 int i;
2823
2824 /* Find an explicit --<option>=<name>[:<value>] entry */
2825 for (i = 0; i < cas->nr; i++) {
2826 struct push_cas *entry = &cas->entry[i];
2827 if (!refname_match(entry->refname, ref->name))
2828 continue;
2829 ref->expect_old_sha1 = 1;
2830 if (!entry->use_tracking)
2831 oidcpy(&ref->old_oid_expect, &entry->expect);
2832 else if (remote_tracking(remote, ref->name,
2833 &ref->old_oid_expect,
2834 &ref->tracking_ref))
2835 oidclr(&ref->old_oid_expect, the_repository->hash_algo);
2836 else
2837 ref->check_reachable = cas->use_force_if_includes;
2838 return;
2839 }
2840
2841 /* Are we using "--<option>" to cover all? */
2842 if (!cas->use_tracking_for_rest)
2843 return;
2844
2845 ref->expect_old_sha1 = 1;
2846 if (remote_tracking(remote, ref->name,
2847 &ref->old_oid_expect,
2848 &ref->tracking_ref))
2849 oidclr(&ref->old_oid_expect, the_repository->hash_algo);
2850 else
2851 ref->check_reachable = cas->use_force_if_includes;
2852}
2853
2854void apply_push_cas(struct push_cas_option *cas,
2855 struct remote *remote,

Callers 1

apply_push_casFunction · 0.85

Calls 4

refname_matchFunction · 0.85
oidcpyFunction · 0.85
remote_trackingFunction · 0.85
oidclrFunction · 0.85

Tested by

no test coverage detected