Check ~name parameter for git downloader
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Elara 2023-01-29 17:36:16 -08:00
parent ee7f4878d1
commit c8be92c47b
1 changed files with 7 additions and 1 deletions

View File

@ -39,6 +39,9 @@ func (GitDownloader) Download(opts Options) (Type, string, error) {
rev := query.Get("~rev")
query.Del("~rev")
name := query.Get("~name")
query.Del("~name")
depthStr := query.Get("~depth")
query.Del("~depth")
@ -90,7 +93,10 @@ func (GitDownloader) Download(opts Options) (Type, string, error) {
}
}
name := strings.TrimSuffix(path.Base(u.Path), ".git")
if name == "" {
name = strings.TrimSuffix(path.Base(u.Path), ".git")
}
return TypeDir, name, nil
}