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

Function remote_tracking

remote.c:2679–2694  ·  view source on GitHub ↗

* Look at remote.fetch refspec and see if we have a remote * tracking branch for the refname there. Fill the name of * the remote-tracking branch in *dst_refname, and the name * of the commit object at its tip in oid[]. * If we cannot do so, return negative to signal an error. */

Source from the content-addressed store, hash-verified

2677 * If we cannot do so, return negative to signal an error.
2678 */
2679static int remote_tracking(struct remote *remote, const char *refname,
2680 struct object_id *oid, char **dst_refname)
2681{
2682 char *dst;
2683
2684 dst = apply_refspecs(&remote->fetch, refname);
2685 if (!dst)
2686 return -1; /* no tracking ref for refname at remote */
2687 if (refs_read_ref(get_main_ref_store(the_repository), dst, oid)) {
2688 free(dst);
2689 return -1; /* we know what the tracking ref is but we cannot read it */
2690 }
2691
2692 *dst_refname = dst;
2693 return 0;
2694}
2695
2696struct check_and_collect_until_cb_data {
2697 struct commit *remote_commit;

Callers 1

apply_casFunction · 0.85

Calls 3

apply_refspecsFunction · 0.85
refs_read_refFunction · 0.85
get_main_ref_storeFunction · 0.85

Tested by

no test coverage detected