* 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. */
| 2677 | * If we cannot do so, return negative to signal an error. |
| 2678 | */ |
| 2679 | static 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 | |
| 2696 | struct check_and_collect_until_cb_data { |
| 2697 | struct commit *remote_commit; |
no test coverage detected