|
|
|
@ -8,7 +8,7 @@ import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"os/exec"
|
|
|
|
"os/exec"
|
|
|
|
"path"
|
|
|
|
"path/filepath"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
|
|
"code.gitea.io/gitea/models"
|
|
|
|
"code.gitea.io/gitea/models"
|
|
|
|
@ -148,7 +148,7 @@ func checkDaemonExport(ctx context.Context, logger log.Logger, autofix bool) err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Create/Remove git-daemon-export-ok for git-daemon...
|
|
|
|
// Create/Remove git-daemon-export-ok for git-daemon...
|
|
|
|
daemonExportFile := path.Join(repo.RepoPath(), `git-daemon-export-ok`)
|
|
|
|
daemonExportFile := filepath.Join(repo.RepoPath(), `git-daemon-export-ok`)
|
|
|
|
isExist, err := util.IsExist(daemonExportFile)
|
|
|
|
isExist, err := util.IsExist(daemonExportFile)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
log.Error("Unable to check if %s exists. Error: %v", daemonExportFile, err)
|
|
|
|
log.Error("Unable to check if %s exists. Error: %v", daemonExportFile, err)
|
|
|
|
@ -196,7 +196,7 @@ func checkCommitGraph(ctx context.Context, logger log.Logger, autofix bool) erro
|
|
|
|
|
|
|
|
|
|
|
|
commitGraphExists := func() (bool, error) {
|
|
|
|
commitGraphExists := func() (bool, error) {
|
|
|
|
// Check commit-graph exists
|
|
|
|
// Check commit-graph exists
|
|
|
|
commitGraphFile := path.Join(repo.RepoPath(), `objects/info/commit-graph`)
|
|
|
|
commitGraphFile := filepath.Join(repo.RepoPath(), `objects/info/commit-graph`)
|
|
|
|
isExist, err := util.IsExist(commitGraphFile)
|
|
|
|
isExist, err := util.IsExist(commitGraphFile)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
logger.Error("Unable to check if %s exists. Error: %v", commitGraphFile, err)
|
|
|
|
logger.Error("Unable to check if %s exists. Error: %v", commitGraphFile, err)
|
|
|
|
@ -204,7 +204,7 @@ func checkCommitGraph(ctx context.Context, logger log.Logger, autofix bool) erro
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if !isExist {
|
|
|
|
if !isExist {
|
|
|
|
commitGraphsDir := path.Join(repo.RepoPath(), `objects/info/commit-graphs`)
|
|
|
|
commitGraphsDir := filepath.Join(repo.RepoPath(), `objects/info/commit-graphs`)
|
|
|
|
isExist, err = util.IsExist(commitGraphsDir)
|
|
|
|
isExist, err = util.IsExist(commitGraphsDir)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
logger.Error("Unable to check if %s exists. Error: %v", commitGraphsDir, err)
|
|
|
|
logger.Error("Unable to check if %s exists. Error: %v", commitGraphsDir, err)
|
|
|
|
|