mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-02 20:19:41 +00: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:
@@ -14,9 +14,9 @@ import (
|
||||
)
|
||||
|
||||
// GetRemoteAddress returns remote url of git repository in the repoPath with special remote name
|
||||
func GetRemoteAddress(ctx context.Context, repoPath, remoteName string) (string, error) {
|
||||
func GetRemoteAddress(ctx context.Context, repo RepositoryFacade, remoteName string) (string, error) {
|
||||
cmd := gitcmd.NewCommand("remote", "get-url").AddDynamicArguments(remoteName)
|
||||
result, _, err := cmd.WithDir(repoPath).RunStdString(ctx)
|
||||
result, _, err := cmd.WithRepo(repo).RunStdString(ctx)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user