mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-30 22:06:11 +01:00
bug fixed for http clone
This commit is contained in:
parent
6cb636f8a0
commit
4210f56dbc
|
@ -10,6 +10,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -333,7 +334,7 @@ func sendFile(contentType string, hr handler) {
|
||||||
http.ServeFile(w, r, reqFile)
|
http.ServeFile(w, r, reqFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
func getGitDir(config *Config, filePath string) (string, error) {
|
func getGitDir(config *Config, fPath string) (string, error) {
|
||||||
root := config.ReposRoot
|
root := config.ReposRoot
|
||||||
|
|
||||||
if root == "" {
|
if root == "" {
|
||||||
|
@ -347,7 +348,11 @@ func getGitDir(config *Config, filePath string) (string, error) {
|
||||||
root = cwd
|
root = cwd
|
||||||
}
|
}
|
||||||
|
|
||||||
f := path.Join(root, filePath)
|
if !strings.HasSuffix(fPath, ".git") {
|
||||||
|
fPath = fPath + ".git"
|
||||||
|
}
|
||||||
|
|
||||||
|
f := filepath.Join(root, fPath)
|
||||||
if _, err := os.Stat(f); os.IsNotExist(err) {
|
if _, err := os.Stat(f); os.IsNotExist(err) {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue