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

ref.Name().Short() doesn't match format git format refs/remotes/origin/* #1011

Open
vish-c opened this issue Jan 24, 2024 · 0 comments
Open

Comments

@vish-c
Copy link

vish-c commented Jan 24, 2024

Dear go-git community

The remote references in my git repository has the following format refs/remotes/origin/%s
But the function reference.Name().Short() seems to match only refs/remotes/%s (doesn't match the origin)

Please see

var RefRevParseRules = []string{

When i execute git branch -a i get the following list ( see it has "origin") in it.

 *master
  remotes/origin/test-new-branch-2
  remotes/origin/test-new-branch-3

I am not sure if i have to change the way i clone the git so that it lists the remote references with out "origin" and I will be able to use the reference.Name().Short() function.

Otherwise, i have the following code as a work around..

if ref.Name().String() == fmt.Sprintf("refs/remotes/origin/%s", branchName) {
fmt.Printf("it matches")
}

Could you please support me here ? Thank you in advance.

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

No branches or pull requests

1 participant