@@ -14,8 +14,8 @@ import (
1414 "code.gitea.io/gitea/modules/util"
1515)
1616
17- // localCopyPath returns the local repository temporary copy path.
18- func localCopyPath () string {
17+ // LocalCopyPath returns the local repository temporary copy path.
18+ func LocalCopyPath () string {
1919 if setting .Repository .Local .LocalCopyPath == "" {
2020 return filepath .Join (setting .TempPath , "local-repo" )
2121 } else if ! filepath .IsAbs (setting .Repository .Local .LocalCopyPath ) {
@@ -26,11 +26,11 @@ func localCopyPath() string {
2626
2727// CreateTemporaryPath creates a temporary path
2828func CreateTemporaryPath (prefix string ) (string , context.CancelFunc , error ) {
29- if err := os .MkdirAll (localCopyPath (), os .ModePerm ); err != nil {
30- log .Error ("Unable to create localcopypath directory: %s (%v)" , localCopyPath (), err )
31- return "" , func () {}, fmt .Errorf ("failed to create localcopypath directory %s: %w" , localCopyPath (), err )
29+ if err := os .MkdirAll (LocalCopyPath (), os .ModePerm ); err != nil {
30+ log .Error ("Unable to create localcopypath directory: %s (%v)" , LocalCopyPath (), err )
31+ return "" , func () {}, fmt .Errorf ("failed to create localcopypath directory %s: %w" , LocalCopyPath (), err )
3232 }
33- basePath , err := os .MkdirTemp (localCopyPath (), prefix + ".git" )
33+ basePath , err := os .MkdirTemp (LocalCopyPath (), prefix + ".git" )
3434 if err != nil {
3535 log .Error ("Unable to create temporary directory: %s-*.git (%v)" , prefix , err )
3636 return "" , func () {}, fmt .Errorf ("failed to create dir %s-*.git: %w" , prefix , err )
0 commit comments