Skip to content

dolt clone can include extraneous remote refs #7043

@zachmu

Description

@zachmu

A remote database can include remote refs (e.g. refs/remotes/origin/branch) for a variety of reasons, including being a backup. During dolt clone, we pull all these refs, then rewrite them to be relative to the remote we just pulled from. If there are any remote refs that don't refer to the same remote we just pulled from, they're just ignored. This means that it's possible that future operations on one of these remote refs will encounter ambiguity and error out.

For example, if the remote database has two refs that like so:

refs/remotes/origin/branch1
refs/remotes/backup/branch1

Then if I run dolt checkout branch1 I'll get an error:

'branch1' matched multiple (2) remote tracking branches.

The solution to this is that during a clone, we should discard any extra remote refs during the ref rewriting process, such that we have only a single set of remote refs which match the name of the remote that we cloned from.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions