mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-22 14:25:18 +02:00
Removed `gitrepo.RunCmd*` functions, because gitcmd.Command works with Repository directly. Move some "local filesystem" related function into "localfs.go"
20 lines
600 B
Go
20 lines
600 B
Go
// Copyright 2025 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package gitrepo
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitea.dev/modules/git"
|
|
"gitea.dev/modules/git/gitcmd"
|
|
)
|
|
|
|
func UpdateRef(ctx context.Context, repo git.RepositoryFacade, refName, newCommitID string) error {
|
|
return gitcmd.NewCommand("update-ref").AddDynamicArguments(refName, newCommitID).WithRepo(repo).Run(ctx)
|
|
}
|
|
|
|
func RemoveRef(ctx context.Context, repo git.RepositoryFacade, refName string) error {
|
|
return gitcmd.NewCommand("update-ref", "--no-deref", "-d").AddDynamicArguments(refName).WithRepo(repo).Run(ctx)
|
|
}
|