mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-23 20:17:03 +01:00
* add git-daemon-export-ok "support" * Slight fix to git-daemon-export-ok * Add error-checking for git-demon-export-ok * Remove old comments and fixed logging-issues * Check if git-daemon-export-ok exists or not
This commit is contained in:
parent
81e6f82caf
commit
b756806ee9
1 changed files with 14 additions and 0 deletions
|
@ -1268,6 +1268,20 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e
|
|||
}
|
||||
}
|
||||
|
||||
// Create/Remove git-daemon-export-ok for git-daemon...
|
||||
daemonExportFile := path.Join(repo.RepoPath(), `git-daemon-export-ok`)
|
||||
if repo.IsPrivate && com.IsExist(daemonExportFile) {
|
||||
if err = os.Remove(daemonExportFile); err != nil {
|
||||
log.Error(4, "Failed to remove %s: %v", daemonExportFile, err)
|
||||
}
|
||||
} else if !repo.IsPrivate && !com.IsExist(daemonExportFile) {
|
||||
if f, err := os.Create(daemonExportFile); err != nil {
|
||||
log.Error(4, "Failed to create %s: %v", daemonExportFile, err)
|
||||
} else {
|
||||
f.Close()
|
||||
}
|
||||
}
|
||||
|
||||
forkRepos, err := getRepositoriesByForkID(e, repo.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("getRepositoriesByForkID: %v", err)
|
||||
|
|
Loading…
Reference in a new issue