From f9adb3565b36ba1573102f954d0ee916009efac2 Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Fri, 25 Nov 2016 15:48:20 +0100 Subject: move: format/packp -> protocol/packp (#141) * move: format/packp -> protocol/packp * format/packp -> protocol/packp * format/packp/pktline -> format/pktline. * move: protocol/packp/ulreq/* -> protocol/packp/* * protocol/packp: rename UlReq types to make them unique. * * protocol/packp: namespace UlReq encoder. * protocol/packp: namespace UlReq decoder. * protocol/packp: fix example names * move: protocol/packp/advrefs/* -> protocol/packp/* * further ulreq namespacing * protocol/packp: namespace AdvRefs types. --- plumbing/format/packp/advrefs/advrefs.go | 58 -------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 plumbing/format/packp/advrefs/advrefs.go (limited to 'plumbing/format/packp/advrefs/advrefs.go') diff --git a/plumbing/format/packp/advrefs/advrefs.go b/plumbing/format/packp/advrefs/advrefs.go deleted file mode 100644 index 4d7c897..0000000 --- a/plumbing/format/packp/advrefs/advrefs.go +++ /dev/null @@ -1,58 +0,0 @@ -// Package advrefs implements encoding and decoding advertised-refs -// messages from a git-upload-pack command. -package advrefs - -import ( - "gopkg.in/src-d/go-git.v4/plumbing" - "gopkg.in/src-d/go-git.v4/plumbing/format/packp" -) - -const ( - hashSize = 40 - head = "HEAD" - noHead = "capabilities^{}" -) - -var ( - sp = []byte(" ") - null = []byte("\x00") - eol = []byte("\n") - peeled = []byte("^{}") - shallow = []byte("shallow ") - noHeadMark = []byte(" capabilities^{}\x00") -) - -// AdvRefs values represent the information transmitted on an -// advertised-refs message. Values from this type are not zero-value -// safe, use the New function instead. -// -// When using this messages over (smart) HTTP, you have to add a pktline -// before the whole thing with the following payload: -// -// '# service=$servicename" LF -// -// Moreover, some (all) git HTTP smart servers will send a flush-pkt -// just after the first pkt-line. -// -// To accomodate both situations, the Prefix field allow you to store -// any data you want to send before the actual pktlines. It will also -// be filled up with whatever is found on the line. -type AdvRefs struct { - Prefix [][]byte // payloads of the prefix - Head *plumbing.Hash - Capabilities *packp.Capabilities - References map[string]plumbing.Hash - Peeled map[string]plumbing.Hash - Shallows []plumbing.Hash -} - -// New returns a pointer to a new AdvRefs value, ready to be used. -func New() *AdvRefs { - return &AdvRefs{ - Prefix: [][]byte{}, - Capabilities: packp.NewCapabilities(), - References: make(map[string]plumbing.Hash), - Peeled: make(map[string]plumbing.Hash), - Shallows: []plumbing.Hash{}, - } -} -- cgit