Documentation ¶
Index ¶
- Variables
- func FindRepo(path string) (bool, string, string, error)
- type BuildRequest
- type Lookup
- type LookupBuildFn
- type Repo
- func (r *Repo) Close() error
- func (r *Repo) HasHeadChanged() bool
- func (r *Repo) HasUpstreamChanged() (bool, error)
- func (r *Repo) IsStale() bool
- func (r *Repo) ModifiedWithContext(ctx context.Context, path string) (time.Time, error)
- func (r *Repo) Open() error
- func (r *Repo) String() string
- func (r *Repo) UpdateFromUpstream() error
- func (r *Repo) Version() (*Version, error)
- func (r *Repo) Versions() (*Versions, error)
- type Version
- type Versions
Constants ¶
This section is empty.
Variables ¶
var (
ErrRepoNotFound = errors.New("no repository found")
)
Functions ¶
Types ¶
type BuildRequest ¶
type BuildRequest struct {
// contains filtered or unexported fields
}
func (*BuildRequest) String ¶
func (br *BuildRequest) String() string
type Lookup ¶
func (*Lookup) GetDirtyOkay ¶
GetDirtyOkay returns the lookup table even when it doesn't match the given ref. However the lookup table must have been build at least once.
If this isn't the case a build will be triggered and the caller can wait until it succeeds. When nil is requested will queue the request and answer it once any ref of the lookup has been built.
func (*Lookup) RequestBuild ¶
type LookupBuildFn ¶
type Repo ¶
type Repo struct { sync.RWMutex // Root of the repository's worktree. Path string // contains filtered or unexported fields }
func NewRepo ¶
NewRepo initializes a new Repo. A mainpath must always be given, an optional subpath may be given when submodules are in use. Optionally an existing Repository may be provided, if none is provided one will be created on the fly.
func (*Repo) HasHeadChanged ¶
func (*Repo) HasUpstreamChanged ¶
func (*Repo) ModifiedWithContext ¶
Modified considers any changes in and below given path as a change to the path. The path must be absolute and rooted at the repository path.
func (*Repo) UpdateFromUpstream ¶
UpdateFromUpstream updates the currently checked out reference from upstream.
TODO: This currently fails with "object not found" or "already up-to-date", or "not-fast-forward", when this shouldn't be the case. We probably have to switch to fetch+hard reset.
type Version ¶
type Version struct { Name string Ref *plumbing.Reference // contains filtered or unexported fields }
func AsLiveVersion ¶
AsLiveVersion converts a version into a "live" one.
func NewVersionFromRef ¶
type Versions ¶
type Versions struct {
// contains filtered or unexported fields
}
func (*Versions) Less ¶
Less will help sort on a best effort basis.
First names of tags and names of branches are separately clustered. Tags come before branches. But the special "live" version comes always first.
Inside the tag cluster tags following semver are sorted according to its rules. If they do not follow the spec they are sorted lexicographically.
Inside the branch cluster names are always sorted lexicographically.