mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 22:13:26 +09:00
refactor: remove unnecessary git command wrapper functions (#38531)
Removed `gitrepo.RunCmd*` functions, because gitcmd.Command works with Repository directly. Move some "local filesystem" related function into "localfs.go"
This commit is contained in:
@@ -6,14 +6,14 @@ package gitrepo
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gitea.dev/modules/git"
|
||||
"gitea.dev/modules/git/gitcmd"
|
||||
)
|
||||
|
||||
func UpdateRef(ctx context.Context, repo Repository, refName, newCommitID string) error {
|
||||
return RunCmd(ctx, repo, gitcmd.NewCommand("update-ref").AddDynamicArguments(refName, newCommitID))
|
||||
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 Repository, refName string) error {
|
||||
return RunCmd(ctx, repo, gitcmd.NewCommand("update-ref", "--no-deref", "-d").
|
||||
AddDynamicArguments(refName))
|
||||
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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user