-
Notifications
You must be signed in to change notification settings - Fork 418
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
Error cloning repositories without branch "master" #444
Comments
GabrielDyck
changed the title
Problem with repositories without branch master
Error cloning repositories without branch "master"
Sep 24, 2021
Unfortunately that is a potentially breaking change and would require a
major version bump. I want to do it, but I have some other major work that
I want to do, and I don't really want to version-bump twice.
…On Thu, Sep 23, 2021, 4:44 PM Gabriel Fernando Dyck < ***@***.***> wrote:
Hi!
I'm have an issue when flag GIT_SYNC_BRANCH is not set. This library
requires know an existing branch of a repository or the repo must have a
branch named "master".
Nowaways, new proyects are created with main branch instead of master, and
when we use this tool it throwns an error.
I watched the repo and in this function
// CloneRepo does an initial clone of the git repo.
func (git *repoSync) CloneRepo(ctx context.Context) error {
args := []string{"clone", "--no-checkout", "-b", git.branch}
and this line
_, err := git.run.Run(ctx, git.root, git.cmd, "worktree", "add",
worktreePath, "origin/"+git.branch, "--no-checkout")
we can make git.branch optional and also change default value from
"master" to "" in GIT_SYNC_BRANCH param.
I did some tests with modified code and works fine.
Let me know your thoughts.
Thank you in advance!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#444>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKWAVHXZY2DOXO5HGMESI3UDO3XTANCNFSM5EUYVNXA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
k8s-ci-robot
added
the
lifecycle/stale
Denotes an issue or PR has remained open with no activity and has become stale.
label
Dec 28, 2021
thockin
removed
the
lifecycle/stale
Denotes an issue or PR has remained open with no activity and has become stale.
label
Jan 3, 2022
Dup of #286 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
I have an issue when flag GIT_SYNC_BRANCH is not set. This component requires know an existing branch of a repository or the repo must have a branch named "master".
Nowaways, new projects are created with main branch instead of master, and when we use this tool it throws an error.
I reviewed the repo and in this function
// CloneRepo does an initial clone of the git repo.
func (git *repoSync) CloneRepo(ctx context.Context) error {
args := []string{"clone", "--no-checkout", "-b", git.branch}
and this line
_, err := git.run.Run(ctx, git.root, git.cmd, "worktree", "add", worktreePath, "origin/"+git.branch, "--no-checkout")
we can make git.branch optional and also change default value from "master" to "" in GIT_SYNC_BRANCH param.
I did some tests with modified code and it worked fine.
Let me know your thoughts.
Thank you in advance!
The text was updated successfully, but these errors were encountered: