repoutil

package
v15.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(
	ctx context.Context,
	locator storage.Locator,
	gitCmdFactory git.CommandFactory,
	txManager transaction.Manager,
	repository *gitalypb.Repository,
	seedRepository func(repository *gitalypb.Repository) error,
	options ...CreateOption,
) error

Create will create a new repository in a race-free way with proper transactional semantics. The repository will only be created if it doesn't yet exist and if nodes which take part in the transaction reach quorum. Otherwise, the target path of the new repository will not be modified. The repository can optionally be seeded with contents

Types

type CreateOption

type CreateOption func(cfg *createConfig)

CreateOption is an option that can be passed to Create.

func WithBranchName

func WithBranchName(branch string) CreateOption

WithBranchName overrides the default branch name that is to be used when creating the repository. If called with an empty string then the default branch name will not be changed.

func WithObjectHash

func WithObjectHash(hash git.ObjectHash) CreateOption

WithObjectHash overrides the default object hash of the created repository.

func WithSkipInit

func WithSkipInit() CreateOption

WithSkipInit causes Create to skip calling git-init(1) so that the seeding function will be called with a nonexistent target directory. This can be useful when using git-clone(1) to seed the repository.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL