aboutsummaryrefslogtreecommitdiffstats
path: root/services/repository/fork.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/repository/fork.go')
-rw-r--r--services/repository/fork.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/services/repository/fork.go b/services/repository/fork.go
index a8ff2717b0..f9c13a109e 100644
--- a/services/repository/fork.go
+++ b/services/repository/fork.go
@@ -14,6 +14,7 @@ import (
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/git"
+ "code.gitea.io/gitea/modules/gitrepo"
"code.gitea.io/gitea/modules/log"
repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/structs"
@@ -167,7 +168,7 @@ func ForkRepository(ctx context.Context, doer, owner *user_model.User, opts Fork
return fmt.Errorf("createDelegateHooks: %w", err)
}
- gitRepo, err := git.OpenRepository(txCtx, repo.RepoPath())
+ gitRepo, err := gitrepo.OpenRepository(txCtx, repo)
if err != nil {
return fmt.Errorf("OpenRepository: %w", err)
}
@@ -190,7 +191,7 @@ func ForkRepository(ctx context.Context, doer, owner *user_model.User, opts Fork
log.Error("Copy language stat from oldRepo failed: %v", err)
}
- gitRepo, err := git.OpenRepository(ctx, repo.RepoPath())
+ gitRepo, err := gitrepo.OpenRepository(ctx, repo)
if err != nil {
log.Error("Open created git repository failed: %v", err)
} else {