This commit is contained in:
silverwind
2026-02-24 08:17:17 +01:00
parent 4fdf9ab904
commit b0ec3fa4fc
34 changed files with 94 additions and 101 deletions

View File

@@ -62,7 +62,6 @@ func FindGitRevision(ctx context.Context, file string) (shortSha string, sha str
EnableDotGitCommonDir: true,
},
)
if err != nil {
logger.WithError(err).Error("path", file, "not located inside a git repository")
return "", "", err
@@ -96,8 +95,8 @@ func FindGitRef(ctx context.Context, file string) (string, error) {
logger.Debugf("HEAD points to '%s'", ref)
// Prefer the git library to iterate over the references and find a matching tag or branch.
var refTag = ""
var refBranch = ""
refTag := ""
refBranch := ""
repo, err := git.PlainOpenWithOptions(
file,
&git.PlainOpenOptions{
@@ -105,7 +104,6 @@ func FindGitRef(ctx context.Context, file string) (string, error) {
EnableDotGitCommonDir: true,
},
)
if err != nil {
return "", err
}
@@ -144,7 +142,6 @@ func FindGitRef(ctx context.Context, file string) (string, error) {
return nil
})
if err != nil {
return "", err
}

View File

@@ -19,7 +19,7 @@ import (
func TestFindGitSlug(t *testing.T) {
assert := assert.New(t)
var slugTests = []struct {
slugTests := []struct {
url string // input
provider string // expected result
slug string // expected result