Documentation ¶
Index ¶
- Variables
- func GetBranchCommitID(ctx context.Context, repo Repository, branch string) (string, error)
- func GetBranchesByPath(ctx context.Context, repo Repository, skip, limit int) ([]*git.Branch, int, error)
- func GetDefaultBranch(ctx context.Context, repo Repository) (string, error)
- func GetWikiDefaultBranch(ctx context.Context, repo Repository) (string, error)
- func OpenRepository(ctx context.Context, repo Repository) (*git.Repository, error)
- func OpenWikiRepository(ctx context.Context, repo Repository) (*git.Repository, error)
- func RepositoryFromContextOrOpen(ctx context.Context, repo Repository) (*git.Repository, io.Closer, error)
- func RepositoryFromContextOrOpenPath(ctx context.Context, path string) (*git.Repository, io.Closer, error)
- func SetDefaultBranch(ctx context.Context, repo Repository, name string) error
- func WalkReferences(ctx context.Context, repo Repository, walkfn func(sha1, refname string) error) (int, error)
- type Repository
Constants ¶
This section is empty.
Variables ¶
var RepositoryContextKey = &contextKey{"repository"}
RepositoryContextKey is a context key. It is used with context.Value() to get the current Repository for the context
Functions ¶
func GetBranchCommitID ¶
func GetBranchesByPath ¶
func GetBranchesByPath(ctx context.Context, repo Repository, skip, limit int) ([]*git.Branch, int, error)
GetBranchesByPath returns a branch by its path if limit = 0 it will not limit
func GetDefaultBranch ¶
func GetDefaultBranch(ctx context.Context, repo Repository) (string, error)
GetDefaultBranch gets default branch of repository.
func GetWikiDefaultBranch ¶
func GetWikiDefaultBranch(ctx context.Context, repo Repository) (string, error)
func OpenRepository ¶
func OpenRepository(ctx context.Context, repo Repository) (*git.Repository, error)
OpenRepository opens the repository at the given relative path with the provided context.
func OpenWikiRepository ¶
func OpenWikiRepository(ctx context.Context, repo Repository) (*git.Repository, error)
func RepositoryFromContextOrOpen ¶
func RepositoryFromContextOrOpen(ctx context.Context, repo Repository) (*git.Repository, io.Closer, error)
RepositoryFromContextOrOpen attempts to get the repository from the context or just opens it
func RepositoryFromContextOrOpenPath ¶
func RepositoryFromContextOrOpenPath(ctx context.Context, path string) (*git.Repository, io.Closer, error)
RepositoryFromContextOrOpenPath attempts to get the repository from the context or just opens it Deprecated: Use RepositoryFromContextOrOpen instead
func SetDefaultBranch ¶
func SetDefaultBranch(ctx context.Context, repo Repository, name string) error
SetDefaultBranch sets default branch of repository.
func WalkReferences ¶
func WalkReferences(ctx context.Context, repo Repository, walkfn func(sha1, refname string) error) (int, error)
WalkReferences walks all the references from the repository