git

package
v0.125.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const GitV1 = "v1"

GitV1 Indicates Git protocol 1 is used

View Source
const GitV2 = "v2"

GitV2 Indicates Git protocol 2 is used

View Source
const ProtocolV2 = "version=2"

ProtocolV2 Git sets the protocol 2 string as in the environment

Variables

View Source
var FallbackTimeValue = time.Unix(1<<63-62135596801, 999999999)

FallbackTimeValue is the value returned by `SafeTimeParse` in case it encounters a parse error. It's the maximum time value possible in golang. See https://gitlab.com/gitlab-org/gitaly/issues/556#note_40289573

Functions

func AddGitProtocolEnv added in v0.125.0

func AddGitProtocolEnv(req RequestWithGitProtocol, env []string) []string

AddGitProtocolEnv checks whether the request has Git protocol v2 and sets this in the environment.

func BuildGitOptions added in v0.118.0

func BuildGitOptions(gitOpts []string, otherOpts ...string) []string

BuildGitOptions helps to generate options to the git command. If gitOpts is not empty then its values are passed as part of the "-c" option of the git command, the other values are passed along with the subcommand.

func Command added in v0.41.0

func Command(ctx context.Context, repo *gitalypb.Repository, args ...string) (*command.Command, error)

Command creates a git.Command with the given args

func CommandWithoutRepo added in v0.92.0

func CommandWithoutRepo(ctx context.Context, args ...string) (*command.Command, error)

CommandWithoutRepo works like Command but without a git repository

func IsValidRef added in v0.41.0

func IsValidRef(ctx context.Context, repo *gitalypb.Repository, ref string) bool

IsValidRef checks if a ref in a repo is valid

func ValidateRevision added in v0.31.0

func ValidateRevision(revision []byte) error

ValidateRevision checks if a revision looks valid

func Version added in v0.46.0

func Version() (string, error)

Version returns the used git version.

Types

type RequestWithGitProtocol added in v0.125.0

type RequestWithGitProtocol interface {
	GetGitProtocol() string
}

RequestWithGitProtocol holds requests that respond to GitProtocol

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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