1
0
forked from rosa/hakurei

internal/rosa/git: determine reporting name from url

This is generally correct, and is a lot cleaner to call.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-04-02 22:42:16 +09:00
parent b948525c07
commit 15bff9e1a6
2 changed files with 7 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ package rosa
import (
"path"
"strings"
"hakurei.app/internal/pkg"
)
@@ -91,10 +92,13 @@ func init() {
// NewViaGit returns a [pkg.Artifact] for cloning a git repository.
func (t Toolchain) NewViaGit(
name, url, rev string,
url, rev string,
checksum pkg.Checksum,
) pkg.Artifact {
return t.New(name+"-"+path.Base(rev), 0, t.AppendPresets(nil,
return t.New(strings.TrimSuffix(
path.Base(url),
".git",
)+"-src-"+path.Base(rev), 0, t.AppendPresets(nil,
NSSCACert,
Git,
), &checksum, nil, `