aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol/packp/updreq_encode_test.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-12-15 09:36:31 +0100
committerGitHub <noreply@github.com>2016-12-15 09:36:31 +0100
commit130bc17dfe2ed88e2f122a0b44a9a45f5114697d (patch)
tree93c0f6919426ac586369a6d3eeb0661cefe5f1cd /plumbing/protocol/packp/updreq_encode_test.go
parent0af572dd21c0aa79d13745b633ee24ba6c4d6cf1 (diff)
downloadgo-git-130bc17dfe2ed88e2f122a0b44a9a45f5114697d.tar.gz
protocol/packp: use ReferenceName type for Command.Name. (#187)
Diffstat (limited to 'plumbing/protocol/packp/updreq_encode_test.go')
-rw-r--r--plumbing/protocol/packp/updreq_encode_test.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/plumbing/protocol/packp/updreq_encode_test.go b/plumbing/protocol/packp/updreq_encode_test.go
index 14f9975..77b715d 100644
--- a/plumbing/protocol/packp/updreq_encode_test.go
+++ b/plumbing/protocol/packp/updreq_encode_test.go
@@ -37,7 +37,7 @@ func (s *UpdReqEncodeSuite) TestZeroValue(c *C) {
func (s *UpdReqEncodeSuite) TestOneUpdateCommand(c *C) {
hash1 := plumbing.NewHash("1ecf0ef2c2dffb796033e5a02219af86ec6584e5")
hash2 := plumbing.NewHash("2ecf0ef2c2dffb796033e5a02219af86ec6584e5")
- name := "myref"
+ name := plumbing.ReferenceName("myref")
r := NewReferenceUpdateRequest()
r.Commands = []*Command{
@@ -58,9 +58,9 @@ func (s *UpdReqEncodeSuite) TestMultipleCommands(c *C) {
r := NewReferenceUpdateRequest()
r.Commands = []*Command{
- {Name: "myref1", Old: hash1, New: hash2},
- {Name: "myref2", Old: plumbing.ZeroHash, New: hash2},
- {Name: "myref3", Old: hash1, New: plumbing.ZeroHash},
+ {Name: plumbing.ReferenceName("myref1"), Old: hash1, New: hash2},
+ {Name: plumbing.ReferenceName("myref2"), Old: plumbing.ZeroHash, New: hash2},
+ {Name: plumbing.ReferenceName("myref3"), Old: hash1, New: plumbing.ZeroHash},
}
expected := pktlines(c,
@@ -79,9 +79,9 @@ func (s *UpdReqEncodeSuite) TestMultipleCommandsAndCapabilities(c *C) {
r := NewReferenceUpdateRequest()
r.Commands = []*Command{
- {Name: "myref1", Old: hash1, New: hash2},
- {Name: "myref2", Old: plumbing.ZeroHash, New: hash2},
- {Name: "myref3", Old: hash1, New: plumbing.ZeroHash},
+ {Name: plumbing.ReferenceName("myref1"), Old: hash1, New: hash2},
+ {Name: plumbing.ReferenceName("myref2"), Old: plumbing.ZeroHash, New: hash2},
+ {Name: plumbing.ReferenceName("myref3"), Old: hash1, New: plumbing.ZeroHash},
}
r.Capabilities.Add("shallow")
@@ -101,9 +101,9 @@ func (s *UpdReqEncodeSuite) TestMultipleCommandsAndCapabilitiesShallow(c *C) {
r := NewReferenceUpdateRequest()
r.Commands = []*Command{
- {Name: "myref1", Old: hash1, New: hash2},
- {Name: "myref2", Old: plumbing.ZeroHash, New: hash2},
- {Name: "myref3", Old: hash1, New: plumbing.ZeroHash},
+ {Name: plumbing.ReferenceName("myref1"), Old: hash1, New: hash2},
+ {Name: plumbing.ReferenceName("myref2"), Old: plumbing.ZeroHash, New: hash2},
+ {Name: plumbing.ReferenceName("myref3"), Old: hash1, New: plumbing.ZeroHash},
}
r.Capabilities.Add("shallow")
r.Shallow = &hash1
@@ -122,7 +122,7 @@ func (s *UpdReqEncodeSuite) TestMultipleCommandsAndCapabilitiesShallow(c *C) {
func (s *UpdReqEncodeSuite) TestWithPackfile(c *C) {
hash1 := plumbing.NewHash("1ecf0ef2c2dffb796033e5a02219af86ec6584e5")
hash2 := plumbing.NewHash("2ecf0ef2c2dffb796033e5a02219af86ec6584e5")
- name := "myref"
+ name := plumbing.ReferenceName("myref")
packfileContent := []byte("PACKabc")
packfileReader := bytes.NewReader(packfileContent)