diff options
author | Anthony HAMON <antham@users.noreply.github.com> | 2017-12-01 16:27:52 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2017-12-01 16:27:52 +0100 |
commit | 44c364fe3b7b8cdc0f9623afe870d6781a97ebb4 (patch) | |
tree | 03284e910c75da7c896381b439c04498eabe63db /plumbing | |
parent | e20d3347d26f0b7193502e2ad7386d7c504b0cde (diff) | |
download | go-git-44c364fe3b7b8cdc0f9623afe870d6781a97ebb4.tar.gz |
Fix revision solver for branch and tag (#660)
fix Repository.ResolveRevision for branch and tag
Diffstat (limited to 'plumbing')
-rw-r--r-- | plumbing/reference.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plumbing/reference.go b/plumbing/reference.go index 2c30fe0..2f53d4e 100644 --- a/plumbing/reference.go +++ b/plumbing/reference.go @@ -15,10 +15,10 @@ const ( symrefPrefix = "ref: " ) -// refRevParseRules are a set of rules to parse references into short names. +// RefRevParseRules are a set of rules to parse references into short names. // These are the same rules as used by git in shorten_unambiguous_ref. // See: https://github.com/git/git/blob/e0aaa1b6532cfce93d87af9bc813fb2e7a7ce9d7/refs.c#L417 -var refRevParseRules = []string{ +var RefRevParseRules = []string{ "refs/%s", "refs/tags/%s", "refs/heads/%s", @@ -83,7 +83,7 @@ func (r ReferenceName) String() string { func (r ReferenceName) Short() string { s := string(r) res := s - for _, format := range refRevParseRules { + for _, format := range RefRevParseRules { _, err := fmt.Sscanf(s, format, &res) if err == nil { continue |