mirror of
https://github.com/gogs/gogs.git
synced 2025-12-24 01:00:00 +01:00
conf: overhaul repository settings (#5932)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
package conf
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
@@ -25,3 +26,11 @@ func openSSHVersion() (string, error) {
|
||||
v = strings.TrimSuffix(strings.TrimPrefix(v, "OpenSSH_"), "p")
|
||||
return v, nil
|
||||
}
|
||||
|
||||
// ensureAbs prepends the WorkDir to the given path if it is not an absolute path.
|
||||
func ensureAbs(path string) string {
|
||||
if filepath.IsAbs(path) {
|
||||
return path
|
||||
}
|
||||
return filepath.Join(WorkDir(), path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user