shithub: furgit

ref: b90593c9b83f71de343e27cd1b489dff79bd4ac7
dir: /refstore/chain/new.go/

View raw version
package chain

import "codeberg.org/lindenii/furgit/refstore"

// New creates an ordered reference store chain.
//
// The provided backends must be non-nil and distinct.
// Chain borrows the provided backends and does not close them in Close.
func New(backends ...refstore.ReadingStore) *Chain {
	return &Chain{
		backends: append([]refstore.ReadingStore(nil), backends...),
	}
}