fix(spec/v1): properly handle empty subdirs

This commit is contained in:
sh0rez 2020-02-29 16:50:56 +01:00
parent fcac885ce2
commit e00d1268e4
No known key found for this signature in database
GPG key ID: 87C71DF9F8181FF1

View file

@ -18,8 +18,10 @@ func FromV0(mv0 v0.JsonnetFile) (JsonnetFile, error) {
case old.Source.GitSource != nil:
d = *deps.Parse("", old.Source.GitSource.Remote)
subdir := filepath.Clean("/" + old.Source.GitSource.Subdir)
d.Source.GitSource.Subdir = subdir
if old.Source.GitSource.Subdir != "" {
subdir := filepath.Clean("/" + old.Source.GitSource.Subdir)
d.Source.GitSource.Subdir = subdir
}
case old.Source.LocalSource != nil:
d = *deps.Parse("", old.Source.LocalSource.Directory)