Fix path cleanup in multiple places (#3871)

This commit is contained in:
Lauris BH
2018-05-01 04:46:04 +03:00
committed by Bo-Yi Wu
parent fff022ef8a
commit 181b3a8f09
3 changed files with 17 additions and 7 deletions

View File

@ -1133,7 +1133,7 @@ type CreateRepoOptions struct {
}
func getRepoInitFile(tp, name string) ([]byte, error) {
cleanedName := strings.TrimLeft(name, "./")
cleanedName := strings.TrimLeft(path.Clean("/"+name), "/")
relPath := path.Join("options", tp, cleanedName)
// Use custom file when available.