chore(mage): silence gosec on worktree branch-exists helpers

The branch name is supplied by the developer running the mage task,
so flagging it as tainted input is a false positive.
This commit is contained in:
kolaente 2026-04-16 15:00:26 +02:00
parent 95ec3325c2
commit 21dcb76dc7
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
1 changed files with 2 additions and 2 deletions

View File

@ -1893,11 +1893,11 @@ func (Generate) ConfigYAML(commented bool) {
} }
func localBranchExists(ctx context.Context, name string) bool { func localBranchExists(ctx context.Context, name string) bool {
return exec.CommandContext(ctx, "git", "show-ref", "--verify", "--quiet", "refs/heads/"+name).Run() == nil return exec.CommandContext(ctx, "git", "show-ref", "--verify", "--quiet", "refs/heads/"+name).Run() == nil //nolint:gosec // This is a dev-only mage task and the branch name is supplied by the developer running it.
} }
func remoteBranchExists(ctx context.Context, name string) bool { func remoteBranchExists(ctx context.Context, name string) bool {
return exec.CommandContext(ctx, "git", "show-ref", "--verify", "--quiet", "refs/remotes/"+name).Run() == nil return exec.CommandContext(ctx, "git", "show-ref", "--verify", "--quiet", "refs/remotes/"+name).Run() == nil //nolint:gosec // This is a dev-only mage task and the branch name is supplied by the developer running it.
} }
// PrepareWorktree creates a new git worktree for development. // PrepareWorktree creates a new git worktree for development.