From 5cf20a4edf7803458a1c2ec94e902369bed76f28 Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Mon, 29 Aug 2016 22:39:08 +0200 Subject: object: Add Encode method to all objects. (#70) Encode method encodes a typed object (commit, tree, tag, blob) into raw core.Object representation. Additionally, Decode does not trim commit message lines. This is needed for Decode/Encode to be idempotent. --- core/memory.go | 1 + 1 file changed, 1 insertion(+) (limited to 'core') diff --git a/core/memory.go b/core/memory.go index 3d8063d..8826966 100644 --- a/core/memory.go +++ b/core/memory.go @@ -50,6 +50,7 @@ func (o *MemoryObject) Writer() (ObjectWriter, error) { func (o *MemoryObject) Write(p []byte) (n int, err error) { o.cont = append(o.cont, p...) + o.sz = int64(len(o.cont)) return len(p), nil } -- cgit