import "github.com/egdaemon/eg/runtime/wasi/eggit"

Package eggit provides functionality around git and assumes that the git command is available.

<a name="Archive"></a>

func Archive

func Archive(dir, dest string) eg.OpFn

Archive creates a gzipped tar archive of the git repository at dir, writing it to dest. The archive is created from the commit specified by the eg environment.

<a name="AutoArchive"></a>

func AutoArchive

func AutoArchive(ctx context.Context, op eg.Op) error

AutoArchive clones the repository from the eg environment and archives it.

<a name="AutoClone"></a>

func AutoClone

func AutoClone(ctx context.Context, _ eg.Op) error

clone the repository specified by the eg environment variables into the working directory.

<a name="Clone"></a>

func Clone

func Clone(ctx context.Context, uri, remote, commit string) error

clone a git repository from the given uri, remote and treeish.

<a name="Commitish"></a>

func Commitish

func Commitish(ctx context.Context, treeish string) string

determine the commit hash for the given name.

<a name="EnvCanonicalURI"></a>

func EnvCanonicalURI

func EnvCanonicalURI() string

<a name="PatternClean"></a>

func PatternClean

func PatternClean(pattern string) string

completely clean any git substitutions from the pattern.

<a name="Pristine"></a>

func Pristine

func Pristine() eg.OpFn

ensures the workspace has not been modified. useful for detecting if there have been changes during the run.

<a name="StringReplace"></a>

func StringReplace

func StringReplace(pattern string) string

substitute values in the provided pattern using the environment variable commit. see commit.StringReplace for more details.