Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git Sources - reusing worktrees breaks if source branch used was created after initial repo clone #396

Open
DavieReid opened this issue Jun 29, 2023 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@DavieReid
Copy link
Contributor

When using a git repo source, the repo is cloned and a worktree created for the branch specified by the source in the mosaic config file.

Now lets say you create a new branch in git and update the mosaic config file so that the source uses this new branch. When you spin up mosaic, it will attempt to reuse the previous clone and create a worktree for the new branch.

But the previous clone has no knowledge of the new branch as we did not do a fetch. This breaks the source as the worktree creation fails.

This may only be an issue that manifests when developing locally and using git repos as sources.

Workaround

The workaround is to remove the .tmp directory so that the clone is removed and the repo cloned again on next start-up.

Ideal Solution

We should do a fetch even when reusing a cloned repo so that we have the latest info about the repo.

@DavieReid DavieReid added bug Something isn't working enhancement New feature or request labels Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant