git

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitAuthor added in v0.33.0

type CommitAuthor struct {
	Name  string
	Email string
}

CommitAuthor is the data (name and email) used when a commit is made

type Config added in v0.33.0

type Config struct {
	// Absolute path to the directory
	Directory string
	// The fetch depth used when cloning, if set to 0, the entire history will be used
	FetchDepth int
}

Config is configuration for any git implementation

type MergeType added in v0.33.0

type MergeType int

MergeType is the way a pull request is "merged" into the base branch

const (
	MergeTypeUnknown MergeType = iota
	MergeTypeMerge
	MergeTypeRebase
	MergeTypeSquash
)

All MergeTypes

func MergeTypeIntersection added in v0.33.0

func MergeTypeIntersection(mergeTypes1, mergeTypes2 []MergeType) []MergeType

MergeTypeIntersection calculates the intersection of two merge type slices, The order of the first slice will be preserved

func ParseMergeType added in v0.33.0

func ParseMergeType(typ string) (MergeType, error)

ParseMergeType parses a merge type

type NewPullRequest added in v0.33.0

type NewPullRequest struct {
	Title string
	Body  string
	Head  string
	Base  string

	Reviewers []string // The username of all reviewers
	Assignees []string
}

NewPullRequest is the data needed to create a new pull request

type PullRequest added in v0.33.0

type PullRequest interface {
	Status() PullRequestStatus
	String() string
}

PullRequest represents a pull request

type PullRequestStatus added in v0.33.0

type PullRequestStatus int

PullRequestStatus is the status of a pull request, including statuses of the last commit

const (
	PullRequestStatusUnknown PullRequestStatus = iota
	PullRequestStatusSuccess
	PullRequestStatusPending
	PullRequestStatusError
	PullRequestStatusMerged
	PullRequestStatusClosed
)

All PullRequestStatuses

func (PullRequestStatus) String added in v0.33.0

func (s PullRequestStatus) String() string

type Repository added in v0.33.0

type Repository interface {
	// CloneURL returns the clone address of the repository
	CloneURL() string
	// DefaultBranch returns the name of the default branch of the repository
	DefaultBranch() string
	// FullName returns the full id of the repository, usually ownerName/repoName
	FullName() string
}

Repository provides all the information needed about a git repository

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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