-
Notifications
You must be signed in to change notification settings - Fork 10
/
repo.go
39 lines (30 loc) · 1.12 KB
/
repo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import "github.com/shurcooL/vcsstate"
// Repo represents a repository that contains Go packages and its state when VCS is non-nil.
// It represents a Go package that is not under a VCS when VCS is nil.
type Repo struct {
// Path is the local filesystem path to the repository or Go package.
Path string
// Root is the import path corresponding to the root of the repository or Go package.
Root string
// vcs allows getting the state of the VCS. It's nil if there's no VCS.
vcs vcsstate.VCS
vcsError error
Local struct {
// RemoteURL is the remote URL, including scheme.
RemoteURL string
Status string
Branch string // Checked out branch.
Revision string
Stash string
ContainsRemoteRevision bool // Computed if Remote.Revision != "".
}
Remote struct {
// RepoURL is the repository URL, including scheme, as determined dynamically from the import path.
RepoURL string
NotFound error // Whether remote repository was not found.
Branch string // Default branch, as determined from remote.
Revision string
ContainsLocalRevision bool // Computed if Local.Revision != "".
}
}