quarantine

package
v16.2.10 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(repoPath string, repo *gitalypb.Repository, quarantineDir string) (*gitalypb.Repository, error)

Apply applies the quarantine on the repository. This is done by setting the quarantineDirectory as the repository's object directory, and configuring the repository's object directory as an alternate.

Types

type Dir

type Dir struct {
	// contains filtered or unexported fields
}

Dir is a quarantine directory for Git objects. Instead of writing new commits into the main repository, they're instead written into a temporary quarantine directory. This staging area can either be migrated into the main repository or, alternatively, will automatically be discarded when the context gets cancelled. If the quarantine environment is discarded without being staged, then none of the objects which have been created in the quarantine directory will end up in the main repository.

func New

func New(ctx context.Context, repo *gitalypb.Repository, locator storage.Locator) (*Dir, error)

New creates a new quarantine directory and returns the directory. The repository is cleaned up when the user invokes the Migrate() functionality on the Dir.

func (*Dir) Migrate

func (d *Dir) Migrate() error

Migrate migrates all objects part of the quarantine directory into the repository and thus makes them generally available. This implementation follows the git.git's `tmp_objdir_migrate()`.

func (*Dir) QuarantinedRepo

func (d *Dir) QuarantinedRepo() *gitalypb.Repository

QuarantinedRepo returns a Repository protobuf message with adjusted main and alternate object directories. If passed e.g. to the `git.ExecCommandFactory`, then all new objects will end up in the quarantine directory.

Jump to

Keyboard shortcuts

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