mirror of https://github.com/go-gitea/gitea.git
Use gitrepo.Repository instead of wikipath (#35398)
Now the wikipath will not be referenced directly.pull/35689/head^2
parent
ebd88af075
commit
a7eceb57a9
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright 2025 The Gitea Authors. All rights reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
package gitrepo
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/modules/git"
|
||||||
|
)
|
||||||
|
|
||||||
|
// CloneExternalRepo clones an external repository to the managed repository.
|
||||||
|
func CloneExternalRepo(ctx context.Context, fromRemoteURL string, toRepo Repository, opts git.CloneRepoOptions) error {
|
||||||
|
return git.Clone(ctx, fromRemoteURL, repoPath(toRepo), opts)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CloneRepoToLocal clones a managed repository to a local path.
|
||||||
|
func CloneRepoToLocal(ctx context.Context, fromRepo Repository, toLocalPath string, opts git.CloneRepoOptions) error {
|
||||||
|
return git.Clone(ctx, repoPath(fromRepo), toLocalPath, opts)
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright 2025 The Gitea Authors. All rights reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
package gitrepo
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/modules/git"
|
||||||
|
)
|
||||||
|
|
||||||
|
func WriteCommitGraph(ctx context.Context, repo Repository) error {
|
||||||
|
return git.WriteCommitGraph(ctx, repoPath(repo))
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright 2025 The Gitea Authors. All rights reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
package gitrepo
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/modules/git"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Push(ctx context.Context, repo Repository, opts git.PushOptions) error {
|
||||||
|
return git.Push(ctx, repoPath(repo), opts)
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright 2025 The Gitea Authors. All rights reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
package gitrepo
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/modules/git"
|
||||||
|
)
|
||||||
|
|
||||||
|
func GetSigningKey(ctx context.Context, repo Repository) (*git.SigningKey, *git.Signature) {
|
||||||
|
return git.GetSigningKey(ctx, repoPath(repo))
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue