aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol/packp/ulreq_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-11-29 15:11:00 +0100
committerGitHub <noreply@github.com>2016-11-29 15:11:00 +0100
commitef1a0579fbc6aac510313ce073d1dd8fc8a9202b (patch)
tree6d41484c70cef0ec6b7582e2ac15b9daccf0e54e /plumbing/protocol/packp/ulreq_test.go
parent47007c70c5a696472576a522cd0e265a777f97a8 (diff)
downloadgo-git-ef1a0579fbc6aac510313ce073d1dd8fc8a9202b.tar.gz
protocol/packp: capabilities new Capability entity and List struct, test improvements (#144)
* protocol/pakp: capabilities new Capability entity and List struct, test improvements * etc: example cloud-config file * removing sorting from List.String
Diffstat (limited to 'plumbing/protocol/packp/ulreq_test.go')
-rw-r--r--plumbing/protocol/packp/ulreq_test.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/plumbing/protocol/packp/ulreq_test.go b/plumbing/protocol/packp/ulreq_test.go
index be02f9d..5e9e978 100644
--- a/plumbing/protocol/packp/ulreq_test.go
+++ b/plumbing/protocol/packp/ulreq_test.go
@@ -8,6 +8,7 @@ import (
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/format/pktline"
+ "gopkg.in/src-d/go-git.v4/plumbing/protocol/packp/capability"
)
func ExampleUlReqEncoder_Encode() {
@@ -20,8 +21,8 @@ func ExampleUlReqEncoder_Encode() {
ur.Wants = append(ur.Wants, plumbing.NewHash("2222222222222222222222222222222222222222"))
// And some capabilities you will like the server to use
- ur.Capabilities.Add("sysref", "HEAD:/refs/heads/master")
- ur.Capabilities.Add("ofs-delta")
+ ur.Capabilities.Add(capability.OFSDelta)
+ ur.Capabilities.Add(capability.SymRef, "HEAD:/refs/heads/master")
// Add a couple of shallows
ur.Shallows = append(ur.Shallows, plumbing.NewHash("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"))
@@ -36,7 +37,7 @@ func ExampleUlReqEncoder_Encode() {
// ...and encode the upload-request to it.
_ = e.Encode(ur) // ignoring errors for brevity
// Output:
- // 005bwant 1111111111111111111111111111111111111111 ofs-delta sysref=HEAD:/refs/heads/master
+ // 005bwant 1111111111111111111111111111111111111111 ofs-delta symref=HEAD:/refs/heads/master
// 0032want 2222222222222222222222222222222222222222
// 0032want 3333333333333333333333333333333333333333
// 0035shallow aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -48,7 +49,7 @@ func ExampleUlReqEncoder_Encode() {
func ExampleUlReqDecoder_Decode() {
// Here is a raw advertised-ref message.
raw := "" +
- "005bwant 1111111111111111111111111111111111111111 ofs-delta sysref=HEAD:/refs/heads/master\n" +
+ "005bwant 1111111111111111111111111111111111111111 ofs-delta symref=HEAD:/refs/heads/master\n" +
"0032want 2222222222222222222222222222222222222222\n" +
"0032want 3333333333333333333333333333333333333333\n" +
"0035shallow aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" +
@@ -79,7 +80,7 @@ func ExampleUlReqDecoder_Decode() {
fmt.Println("depth =", string(depth))
}
// Output:
- // capabilities = ofs-delta sysref=HEAD:/refs/heads/master
+ // capabilities = ofs-delta symref=HEAD:/refs/heads/master
// wants = [1111111111111111111111111111111111111111 2222222222222222222222222222222222222222 3333333333333333333333333333333333333333]
// shallows = [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb]
// depth = 2015-01-02 03:04:05 +0000 UTC