aboutsummaryrefslogtreecommitdiffstats
path: root/common_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-07-24 12:53:45 +0200
committerGitHub <noreply@github.com>2017-07-24 12:53:45 +0200
commit4ee12ab91dc23ef1f6f04a6326ead904f21baf7b (patch)
tree12e4a29754efd3d2b86afea1a20744c5bcb2d9ca /common_test.go
parentef234e7e7355281499a63c4b22550df023b61fbf (diff)
parent39ecae56e6246f8118c14a2cb6ca18660b7fef99 (diff)
downloadgo-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.go11
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)
+ }
+}