Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gx/lastpubver
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.5: QmTH9uimkEFHc7HcrFSG2pMskWLSfnRb8HKUngiP7r4iDN
0.3.0: QmRNxeMQs2eVPouLxwa4tN72yTLLgWAi1cChXqgdEz5Ko4
2 changes: 1 addition & 1 deletion blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

type Blob []byte

func (b Blob) Cid() *cid.Cid {
func (b Blob) Cid() cid.Cid {
c, _ := cid.Prefix{
MhType: mh.SHA1,
MhLength: -1,
Expand Down
10 changes: 5 additions & 5 deletions commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (

type Commit struct {
DataSize string `json:"-"`
GitTree *cid.Cid `json:"tree"`
Parents []*cid.Cid `json:"parents"`
GitTree cid.Cid `json:"tree"`
Parents []cid.Cid `json:"parents"`
Message string `json:"message"`
Author *PersonInfo `json:"author"`
Committer *PersonInfo `json:"committer"`
Expand All @@ -26,7 +26,7 @@ type Commit struct {
// Other contains all the non-standard headers, such as 'HG:extra'
Other []string `json:"other,omitempty"`

cid *cid.Cid
cid cid.Cid
}

type PersonInfo struct {
Expand Down Expand Up @@ -80,7 +80,7 @@ func (pi *PersonInfo) resolve(p []string) (interface{}, []string, error) {
}

type MergeTag struct {
Object *cid.Cid `json:"object"`
Object cid.Cid `json:"object"`
Type string `json:"type"`
Tag string `json:"tag"`
Tagger *PersonInfo `json:"tagger"`
Expand All @@ -91,7 +91,7 @@ type GpgSig struct {
Text string
}

func (c *Commit) Cid() *cid.Cid {
func (c *Commit) Cid() cid.Cid {
return c.cid
}

Expand Down
6 changes: 3 additions & 3 deletions git.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func ReadTag(rd *bufio.Reader) (*Tag, error) {
return out, nil
}

func hashObject(data []byte) *cid.Cid {
func hashObject(data []byte) cid.Cid {
c, err := cid.Prefix{
MhType: mh.SHA1,
MhLength: -1,
Expand Down Expand Up @@ -437,12 +437,12 @@ func ReadTree(rd *bufio.Reader) (*Tree, error) {
return t, nil
}

func cidToSha(c *cid.Cid) []byte {
func cidToSha(c cid.Cid) []byte {
h := c.Hash()
return h[len(h)-20:]
}

func shaToCid(sha []byte) *cid.Cid {
func shaToCid(sha []byte) cid.Cid {
h, _ := mh.Encode(sha, mh.SHA1)
return cid.NewCidV1(cid.GitRaw, h)
}
Expand Down
4 changes: 2 additions & 2 deletions git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func testNode(t *testing.T, nd node.Node) error {

/*s, _ := commit.Size()
assert.Equal(t, len(commit.RawData()), int(s))*/ //TODO: Known breakage
assert(t, commit.GitTree != nil)
assert(t, commit.GitTree.Defined())
assert(t, commit.Links() != nil)
assert(t, commit.Loggable()["type"] == "git_commit")

Expand Down Expand Up @@ -228,7 +228,7 @@ func testNode(t *testing.T, nd node.Node) error {
}

assert(t, tag.Type == "commit" || tag.Type == "tree" || tag.Type == "blob" || tag.Type == "tag")
assert(t, tag.Object != nil)
assert(t, tag.Object.Defined())
assert(t, tag.Loggable()["type"] == "git_tag")
assert(t, tag.Tree("", -1) != nil)
obj, rest, err := tag.ResolveLink([]string{"object", "aoeu"})
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
"gxDependencies": [
{
"author": "whyrusleeping",
"hash": "QmX5CsuHyVZeTLxgRSYkgLSDQKb9UjE8xnhQzCEJWWWFsC",
"hash": "QmdDXJs4axxefSPgK6Y1QhpJWKuDPnGJiqgq4uncb4rFHL",
"name": "go-ipld-format",
"version": "0.5.8"
"version": "0.6.0"
},
{
"author": "whyrusleeping",
"hash": "QmZFbDTY9jfSBms2MchvYM9oYRbAF19K7Pby47yDBfpPrb",
"hash": "QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7",
"name": "go-cid",
"version": "0.8.0"
"version": "0.9.0"
},
{
"author": "stebalien",
"hash": "QmWAzSEoqZ6xU6pu8yL8e5WaMb7wtbfbhhN4p1DknUPtr3",
"hash": "QmRcHuYzAyswytBuMF78rj3LTChYszomRFXNg4685ZN1WM",
"name": "go-block-format",
"version": "0.1.11"
"version": "0.2.0"
},
{
"author": "multiformats",
Expand All @@ -37,6 +37,6 @@
"license": "",
"name": "go-ipld-git",
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
"version": "0.2.5"
"version": "0.3.0"
}

6 changes: 3 additions & 3 deletions tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ import (
)

type Tag struct {
Object *cid.Cid `json:"object"`
Object cid.Cid `json:"object"`
Type string `json:"type"`
Tag string `json:"tag"`
Tagger *PersonInfo `json:"tagger"`
Message string `json:"message"`
dataSize string

cid *cid.Cid
cid cid.Cid
}

func (t *Tag) Cid() *cid.Cid {
func (t *Tag) Cid() cid.Cid {
return t.cid
}

Expand Down
6 changes: 3 additions & 3 deletions tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ type Tree struct {
entries map[string]*TreeEntry
size int
order []string
cid *cid.Cid
cid cid.Cid
}

type TreeEntry struct {
name string
Mode string `json:"mode"`
Hash *cid.Cid `json:"hash"`
Hash cid.Cid `json:"hash"`
}

func (t *Tree) Cid() *cid.Cid {
func (t *Tree) Cid() cid.Cid {
return t.cid
}

Expand Down