diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-07-24 12:53:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-24 12:53:45 +0200 |
commit | 4ee12ab91dc23ef1f6f04a6326ead904f21baf7b (patch) | |
tree | 12e4a29754efd3d2b86afea1a20744c5bcb2d9ca /common_test.go | |
parent | ef234e7e7355281499a63c4b22550df023b61fbf (diff) | |
parent | 39ecae56e6246f8118c14a2cb6ca18660b7fef99 (diff) | |
download | go-git-4ee12ab91dc23ef1f6f04a6326ead904f21baf7b.tar.gz |
Merge pull request #498 from mcuadros/fix-push
remote: push, update remote refs on push
Diffstat (limited to 'common_test.go')
-rw-r--r-- | common_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common_test.go b/common_test.go index 21b4481..a7cd755 100644 --- a/common_test.go +++ b/common_test.go @@ -169,3 +169,14 @@ func (s *SuiteCommon) TestCountLines(c *C) { c.Assert(o, Equals, t.e, Commentf("subtest %d, input=%q", i, t.i)) } } + +func AssertReferences(c *C, r *Repository, expected map[string]string) { + for name, target := range expected { + expected := plumbing.NewReferenceFromStrings(name, target) + + obtained, err := r.Reference(expected.Name(), true) + c.Assert(err, IsNil) + + c.Assert(obtained, DeepEquals, expected) + } +} |