Move get/set default branch from git package to gitrepo package to hide repopath (#29126)
This commit is contained in:
parent
a1f5dd7677
commit
25b842df26
15 changed files with 52 additions and 63 deletions
|
@ -57,14 +57,7 @@ func cloneWiki(ctx context.Context, u *user_model.User, opts migration.MigrateOp
|
|||
return "", err
|
||||
}
|
||||
|
||||
wikiRepo, err := git.OpenRepository(ctx, wikiPath)
|
||||
if err != nil {
|
||||
cleanIncompleteWikiPath()
|
||||
return "", fmt.Errorf("failed to open wiki repo %q, err: %w", wikiPath, err)
|
||||
}
|
||||
defer wikiRepo.Close()
|
||||
|
||||
defaultBranch, err := wikiRepo.GetDefaultBranch()
|
||||
defaultBranch, err := git.GetDefaultBranch(ctx, wikiPath)
|
||||
if err != nil {
|
||||
cleanIncompleteWikiPath()
|
||||
return "", fmt.Errorf("failed to get wiki repo default branch for %q, err: %w", wikiPath, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue