Re: [PATCH v2 1/3] branch: move --set-upstream-to behavior to setup_tracking()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 6, 2021, 23:28 UTC
- Message-ID
- <xmqq1r2pcnyw.fsf@gitster.g>
- In-Reply-To
- <20211206215528.97050-2-chooglen@google.com>
Glen Choo <chooglen@google.com> writes:
Show 24 quoted lines
> +void setup_tracking(const char *new_ref, const char *orig_ref,
> + enum branch_track track, int quiet, int expand_orig)
> +{
> + struct tracking tracking;
> + int config_flags = quiet ? 0 : BRANCH_CONFIG_VERBOSE;
> + char *full_orig_ref;
> + struct object_id unused_oid;
> +
> + memset(&tracking, 0, sizeof(tracking));
> + if (expand_orig)
> + validate_branch_start(the_repository, orig_ref, track, &unused_oid, &full_orig_ref);
> + else
> + full_orig_ref = xstrdup(orig_ref);
> +
> + tracking.spec.dst = full_orig_ref;
> + if (for_each_remote(find_tracked_branch, &tracking))
> + goto cleanup;
> +
> + if (!tracking.matches)
> + switch (track) {
> + case BRANCH_TRACK_ALWAYS:
> + case BRANCH_TRACK_EXPLICIT:
> + case BRANCH_TRACK_OVERRIDE:
> + break;This heavily conflicts with what another topic "inherit tracking info from the other branch" wants to do to this function. What's the status of that topic, by the way? Should we block this one waiting for the other, or the other way around?
Thanks.