mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-04 15:25:00 -04:00
Document exported funcs,types,interfaces and enable check. (#475)
* Include EXC0014 and fix issues. * Include EXC0012 and fix issues. Signed-off-by: Fabian Kammel <fk@edgeless.systems> Co-authored-by: Otto Bittner <cobittner@posteo.net>
This commit is contained in:
parent
c9873f2bfb
commit
0d12e37c96
74 changed files with 337 additions and 78 deletions
|
@ -23,10 +23,12 @@ var (
|
|||
tagReference = regexp.MustCompile(`^refs/tags/([^/]+)$`)
|
||||
)
|
||||
|
||||
// Git represents a git repository.
|
||||
type Git struct {
|
||||
repo *git.Repository
|
||||
}
|
||||
|
||||
// New opens the git repository in current directory.
|
||||
func New() (*Git, error) {
|
||||
repo, err := git.PlainOpenWithOptions("", &git.PlainOpenOptions{DetectDotGit: true})
|
||||
return &Git{repo: repo}, err
|
||||
|
@ -106,6 +108,7 @@ func (g *Git) ParsedBranchName() (string, error) {
|
|||
return strings.TrimSuffix(branch, "-"), nil
|
||||
}
|
||||
|
||||
// BranchName of current HEAD.
|
||||
func (g *Git) BranchName() (string, error) {
|
||||
commitRef, err := g.repo.Head()
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue