aboutsummaryrefslogtreecommitdiff
path: root/object/store/memory/add.go
blob: 3946c89e3a826691bf4fdfd0c86fa3dfad6a9cb6 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package memory

import (
	objectid "codeberg.org/lindenii/furgit/object/id"
	objecttype "codeberg.org/lindenii/furgit/object/type"
)

// AddObject stores one object body and returns its object ID.
//
//go:fix inline
func (store *Store) AddObject(ty objecttype.Type, body []byte) objectid.ObjectID {
	id, err := store.WriteBytesContent(ty, body)
	if err != nil {
		panic(err)
	}

	return id
}