MCPcopy Create free account
hub / github.com/gogs/gogs / getRepoInitFile

Function getRepoInitFile

internal/database/repo.go:979–988  ·  view source on GitHub ↗
(tp, name string)

Source from the content-addressed store, hash-verified

977}
978
979func getRepoInitFile(tp, name string) ([]byte, error) {
980 relPath := path.Join(tp, strings.TrimLeft(path.Clean("/"+name), "/"))
981
982 // Use custom file when available.
983 customPath := filepath.Join(conf.CustomDir(), "conf", relPath)
984 if osutil.IsFile(customPath) {
985 return os.ReadFile(customPath)
986 }
987 return embedConf.Files.ReadFile(relPath)
988}
989
990func prepareRepoCommit(repo *Repository, tmpDir, repoPath string, opts CreateRepoOptionsLegacy) error {
991 // Clone to temporary path and do the init commit.

Callers 2

prepareRepoCommitFunction · 0.85
GetLabelTemplateFileFunction · 0.85

Calls 2

CustomDirFunction · 0.92
IsFileFunction · 0.92

Tested by

no test coverage detected