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

Sync remotes #15

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

SuperSandro2000
Copy link
Contributor

@SuperSandro2000 SuperSandro2000 commented Oct 25, 2023

When deleting a remote that is registered in the index, rtree now asks what to do with it like when encountering a deleted repo.

Closes #11

This makes things obvious in case a remote name is remote or has
@SuperSandro2000
Copy link
Contributor Author

@majewsky ping

@@ -381,7 +465,7 @@ func (i *Index) ImportRepo(dirPath string) error {
return errors.New("repo has no remotes")
}

question := fmt.Sprintf("Repo has multiple remotes. Where to put below %s?", RootPath)
question := fmt.Sprintf(`Repo has multiple remotes. Where to put below "%s"?`, RootPath)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
question := fmt.Sprintf(`Repo has multiple remotes. Where to put below "%s"?`, RootPath)
question := fmt.Sprintf("Repo has multiple remotes. Where to put below %q?", RootPath)


// ask the user what to do with remotes not existing in checked out repo
selection, err := cli.Interface.Query(
fmt.Sprintf(`repository "%s" remote "%s" has been deleted`, repo.AbsolutePath(), remote.Name),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmt.Sprintf(`repository "%s" remote "%s" has been deleted`, repo.AbsolutePath(), remote.Name),
fmt.Sprintf(`repository %q remote %q has been deleted`, repo.AbsolutePath(), remote.Name),

Also, I suggest the clearer phrasing remote %q of repository %q has been deleted.

toUpdate = append(toUpdate, remote.Name)
newRemotes = append(newRemotes, remote)
case "d":
case "s":
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s should add the remote to the new list, i.e. effectively not touch it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rtree index is not syncing remotes to repos
2 participants