{"modulePath":"github.com/github/git-media","version":"v2.4.2+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package test\n\n## Constants\n\n```go\nconst (\n\t// Normal repo with working copy\n\tRepoTypeNormal = RepoType(iota)\n\t// Bare repo (no working copy)\n\tRepoTypeBare = RepoType(iota)\n\t// Repo with working copy but git dir is separate\n\tRepoTypeSeparateDir = RepoType(iota)\n)\n```\n\n## Functions\n\n```go\nfunc RunGitCommand(callback RepoCallback, failureCheck bool, args ...string) string\n```\nSimplistic fire \u0026 forget running of git command - returns combined output\n\n## Types\n\n```go\ntype CommitInput struct {\n\t// Date that we should commit on (optional, leave blank for 'now')\n\tCommitDate time.Time\n\t// List of files to include in this commit\n\tFiles []*FileInput\n\t// List of parent branches (all branches must have been created in a previous NewBranch or be master)\n\t// Can be omitted to just use the parent of the previous commit\n\tParentBranches []string\n\t// Name of a new branch we should create at this commit (optional - master not required)\n\tNewBranch string\n\t// Names of any tags we should create at this commit (optional)\n\tTags []string\n\t// Name of committer\n\tCommitterName string\n\t// Email of committer\n\tCommitterEmail string\n}\n```\nInput for defining commits for test repo\n\n```go\ntype CommitOutput struct {\n\tSha     string\n\tParents []string\n\tFiles   []*lfs.Pointer\n}\n```\nOutput struct with details of commits created for test\n\n```go\ntype FileInput struct {\n\t// Name of file (required)\n\tFilename string\n\t// Size of file (required)\n\tSize int64\n\t// Input data (optional, if provided will be source of data)\n\tDataReader io.Reader\n\t// Input data (optional, if provided will be source of data)\n\tData string\n}\n```\nInput data for a single file in a commit\n\n```go\nfunc (infile *FileInput) AddToIndex(output *CommitOutput, repo *Repo)\n```\n\n```go\ntype PlaceholderDataReader struct {\n\t// contains filtered or unexported fields\n}\n```\nJust a psuedo-random stream of bytes (not cryptographic) Calls RNG a bit less often than using rand.Source directly\n\n```go\nfunc NewPlaceholderDataReader(seed, size int64) *PlaceholderDataReader\n```\n\n```go\nfunc (r *PlaceholderDataReader) Read(p []byte) (int, error)\n```\n\n```go\ntype PointersByOid []*lfs.Pointer\n```\nPointersByOid implements sort.Interface for \\[]\\*lfs.Pointer based on oid\n\n```go\nfunc (a PointersByOid) Len() int\n```\n\n```go\nfunc (a PointersByOid) Less(i, j int) bool\n```\n\n```go\nfunc (a PointersByOid) Swap(i, j int)\n```\n\n```go\ntype RefsByName []*git.Ref\n```\nRefsByName implements sort.Interface for \\[]\\*git.Ref based on name\n\n```go\nfunc (a RefsByName) Len() int\n```\n\n```go\nfunc (a RefsByName) Less(i, j int) bool\n```\n\n```go\nfunc (a RefsByName) Swap(i, j int)\n```\n\n```go\ntype Repo struct {\n\t// Path to the repo, working copy if non-bare\n\tPath string\n\t// Path to the git dir\n\tGitDir string\n\t// Paths to remotes\n\tRemotes map[string]*Repo\n\t// Settings used to create this repo\n\tSettings *RepoCreateSettings\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewRepo(callback RepoCallback) *Repo\n```\nNewRepo creates a new git repo in a new temp dir\n\n```go\nfunc WrapRepo(c RepoCallback, path string) *Repo\n```\nWrapRepo creates a new Repo instance for an existing git repo\n\n```go\nfunc (repo *Repo) AddCommits(inputs []*CommitInput) []*CommitOutput\n```\n\n```go\nfunc (r *Repo) AddRemote(name string) *Repo\n```\nAdd a new remote (generate a path for it to live in, will be cleaned up)\n\n```go\nfunc (r *Repo) Cleanup()\n```\n\n```go\nfunc (r *Repo) Filesystem() *fs.Filesystem\n```\n\n```go\nfunc (r *Repo) GitConfig() *git.Configuration\n```\n\n```go\nfunc (r *Repo) GitEnv() config.Environment\n```\n\n```go\nfunc (r *Repo) OSEnv() config.Environment\n```\n\n```go\nfunc (r *Repo) Popd()\n```\n\n```go\nfunc (r *Repo) Pushd()\n```\nChange to repo dir but save current dir\n\n```go\ntype RepoCallback interface {\n\t// Fatalf reports error and fails\n\tFatalf(format string, args ...interface{})\n\t// Errorf reports error and continues\n\tErrorf(format string, args ...interface{})\n}\n```\nCallback interface (testing.T compatible)\n\n```go\ntype RepoCreateSettings struct {\n\tRepoType RepoType\n}\n```\n\n```go\ntype RepoType int\n```\n\n```go\ntype WrappedPointersByOid []*lfs.WrappedPointer\n```\nWrappedPointersByOid implements sort.Interface for \\[]\\*lfs.WrappedPointer based on oid\n\n```go\nfunc (a WrappedPointersByOid) Len() int\n```\n\n```go\nfunc (a WrappedPointersByOid) Less(i, j int) bool\n```\n\n```go\nfunc (a WrappedPointersByOid) Swap(i, j int)\n```\n\n","path":"github.com/github/git-media/test","name":"test","synopsis":"","isRedistributable":true}
