Documentation ¶
Index ¶
- Constants
- Variables
- func AddGitProtocolEnv(ctx context.Context, req RequestWithGitProtocol, env []string) []string
- func BareCommand(ctx context.Context, stdin io.Reader, stdout, stderr io.Writer, env []string, ...) (*command.Command, error)
- func BuildGitOptions(gitOpts []string, otherOpts ...string) []string
- func Command(ctx context.Context, repo repository.GitRepo, args ...string) (*command.Command, error)
- func CommandWithoutRepo(ctx context.Context, args ...string) (*command.Command, error)
- func IsValidRef(ctx context.Context, repo *gitalypb.Repository, ref string) bool
- func ValidateRevision(revision []byte) error
- func Version() (string, error)
- type RequestWithGitProtocol
Constants ¶
const (
// ProtocolV2 is the special value used by Git clients to request protocol v2
ProtocolV2 = "version=2"
)
Variables ¶
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(ctx context.Context, req RequestWithGitProtocol, env []string) []string
AddGitProtocolEnv checks whether the request has Git protocol v2 and sets this in the environment.
func BareCommand ¶ added in v0.126.0
func BareCommand(ctx context.Context, stdin io.Reader, stdout, stderr io.Writer, env []string, args ...string) (*command.Command, error)
BareCommand creates a git.Command with the given args, stdin/stdout/stderr, and env
func BuildGitOptions ¶ added in v0.118.0
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 repository.GitRepo, args ...string) (*command.Command, error)
Command creates a git.Command with the given args and Repository
func CommandWithoutRepo ¶ added in v0.92.0
CommandWithoutRepo works like Command but without a git repository
func IsValidRef ¶ added in v0.41.0
IsValidRef checks if a ref in a repo is valid
func ValidateRevision ¶ added in v0.31.0
ValidateRevision checks if a revision looks valid
Types ¶
type RequestWithGitProtocol ¶ added in v0.125.0
type RequestWithGitProtocol interface {
GetGitProtocol() string
}
RequestWithGitProtocol holds requests that respond to GitProtocol