From: Junio C Hamano <gitster@pobox.com>
To: "tsukasa-ino via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, tsukasa-ino <inoue.tsukasa.4@gmail.com>
Subject: Re: [PATCH] branch: strip refs/heads/ from the --set-upstream-to hint
Date: Tue, 20 Oct 2026 12:51:53 -0700 [thread overview]
Message-ID: <xmqq7bjcup46.fsf@gitster.g> (raw)
In-Reply-To: <pull.2268.git.1792458904027.gitgitgadget@gmail.com> (tsukasa-ino via GitGitGadget's message of "Tue, 20 Oct 2026 01:15:04 +0000")
"tsukasa-ino via GitGitGadget" <gitgitgadget@gmail.com> writes:
> hint: git branch --set-upstream-to=origin/refs/heads/feat
>
> The hint says origin/refs/heads/feat, but the correct name is
> origin/feat. Running the command as printed fails, because the full
> ref name is not a valid remote-tracking branch name here.
Good observation. Thanks for noticing.
> +test_expect_success '--set-upstream-to hint uses short remote-tracking branch name on locked config' '
> + test_when_finished "git branch -D hint-local" &&
> + test_when_finished "git update-ref -d refs/remotes/hintremote/hintbranch" &&
> + test_config remote.hintremote.url . &&
> + test_config remote.hintremote.fetch "+refs/heads/*:refs/remotes/hintremote/*" &&
> + git update-ref refs/remotes/hintremote/hintbranch HEAD &&
> + git branch hint-local &&
> + test_when_finished "rm -f .git/config.lock" &&
> + >.git/config.lock &&
> + test_must_fail git -c core.configLockTimeout=0 \
> + branch --set-upstream-to=hintremote/hintbranch hint-local 2>err &&
> + test_grep "git branch --set-upstream-to=hintremote/hintbranch\$" err &&
> + test_grep ! "refs/heads/" err
Perhaps it makes sense to also test that the suggested command line
is accepted after all of the above?
> +'
Thanks.
prev parent reply other threads:[~2026-10-20 19:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 1:15 [PATCH] branch: strip refs/heads/ from the --set-upstream-to hint tsukasa-ino via GitGitGadget
2026-10-20 19:51 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq7bjcup46.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=inoue.tsukasa.4@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.