diff options
author | David Symonds <dsymonds@golang.org> | 2020-07-15 13:52:04 +1000 |
---|---|---|
committer | David Symonds <dsymonds@golang.org> | 2020-07-16 12:53:37 +1000 |
commit | e28d9c90aad624596d20d1a59c8371d81b69190b (patch) | |
tree | 5785565db48069ff8f173b9dddcbb1b4c1f7e8ff /internal/revision/parser_test.go | |
parent | 41758ec4b81c557092d7566c3eed46f89c1ec3cc (diff) | |
download | go-git-e28d9c90aad624596d20d1a59c8371d81b69190b.tar.gz |
Support partial hashes in Repository.ResolveRevision.
Like `git rev-parse <prefix>`, this enumerates the hashes of objects
with the given prefix and adds them to the list of candidates for
resolution.
This has an exhaustive slow path, which requires enumerating all objects
and filtering each one, but also a couple of fast paths for common
cases. There's room for future work to make this faster; TODOs have been
left for that.
Fixes #135.
Diffstat (limited to 'internal/revision/parser_test.go')
-rw-r--r-- | internal/revision/parser_test.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/revision/parser_test.go b/internal/revision/parser_test.go index 4bb007f..98403cc 100644 --- a/internal/revision/parser_test.go +++ b/internal/revision/parser_test.go @@ -354,6 +354,7 @@ func (s *ParserSuite) TestParseRefWithValidName(c *C) { "refs/remotes/test", "refs/remotes/origin/HEAD", "refs/remotes/origin/master", + "0123abcd", // short hash } for _, d := range datas { |