checkout

package
v0.0.0-...-d29f491 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: BSD-3-Clause Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureGitCheckout

func EnsureGitCheckout(ctx context.Context, dest string, rs types.RepoState) (*git.Checkout, error)

EnsureGitCheckout obtains a clean git checkout of the given repo, at the given commit, in the given destination dir.

func EnsureGitCheckoutWithDEPS

func EnsureGitCheckoutWithDEPS(ctx context.Context, workdir string, rs types.RepoState) (co *git.Checkout, err error)

EnsureGitCheckoutWithDEPS obtains a clean git checkout of the given repo, at the given commit, in the given workdir, and syncs the DEPS as well. The checkout itself will be a subdirectory of the workdir.

func GetRepoState

func GetRepoState(f *Flags) (types.RepoState, error)

GetRepoState creates a RepoState from the given Flags.

func ValidateCheckout

func ValidateCheckout(ctx context.Context, dest string, rs types.RepoState) (bool, error)

ValidateCheckout returns true if the git checkout in the given destination dir is in a reasonable state. Assumes that the dest dir exists.

Types

type Flags

type Flags struct {
	PatchIssue  *string
	PatchServer *string
	PatchSet    *string
	Repo        *string
	Revision    *string
}

Flags contains command-line flags used by this package.

func SetupFlags

func SetupFlags(fs *flag.FlagSet) *Flags

SetupFlags initializes command-line flags used by this package. If a FlagSet is not provided, then these become top-level CommandLine flags.

Jump to

Keyboard shortcuts

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