diff options
| author | Yoichi NAKAYAMA <yoichi.nakayama@gmail.com> | 2026-08-27 14:41:56 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-08-27 10:29:43 -0700 |
| commit | 85489606d89d44d7aed6e46839ec8ff46f52562d (patch) | |
| tree | b1eebac5e1d4761238ff9e368d54139561f9a871 /contrib/persistent-https | |
| parent | 05cf4ceb5bc28580ef30cb45c8bbd8b447431cf4 (diff) | |
worktree add: improve message for ambiguous remote branch name
When the user runs 'git worktree add ../foo-dir bar-topic' without
specifying a remote, and there is no local branch named bar-topic, we
try to guess which remote branch bar-topic refers to, then create a
new branch named bar-topic that tracks the remote branch.
If multiple remotes have a branch named bar-topic, we silently gave
up, leaving the variable 'branch' intact. We then entered the
conditional clause 'if (!opts.orphan &&
!lookup_commit_reference_by_name(branch))' and triggered an "invalid
reference" error. This error message did not provide enough
information to resolve the ambiguity.
When multiple matching branches are found, display a hint and a
descriptive error message and die immediately.
Signed-off-by: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions
