@@ -15,8 +15,6 @@ import (
15
15
16
16
var processed = make ([]string , 0 )
17
17
18
- var processedOld = 0
19
-
20
18
func EnsureDependencies (pkg * models.Package ) {
21
19
if pkg .Dependencies == nil {
22
20
return
@@ -56,11 +54,10 @@ func ensureModules(pkg *models.Package, deps []models.Dependency) {
56
54
short := version .Name ().Short ()
57
55
newVersion , err := semver .NewVersion (short )
58
56
if err != nil {
59
- msg .Warn ("\t Erro to parse version %s: '%s' in dependency %s " , short , err , dep . Repository )
57
+ msg .Warn ("\t Invalid semantic version: %s " , short )
60
58
continue
61
59
}
62
60
if constraints .Check (newVersion ) {
63
- //msg.Info("Dependency %s with version %s", dep.Repository, newVersion.String())
64
61
hasMatch = true
65
62
if bestVersion == nil || newVersion .GreaterThan (bestVersion ) {
66
63
bestMatch = version
@@ -80,7 +77,8 @@ func ensureModules(pkg *models.Package, deps []models.Dependency) {
80
77
worktree .Filesystem .TempFile (filepath .Join (env .GetCacheDir (), "tmp" ), "tpt" )
81
78
err := worktree .Checkout (& git2.CheckoutOptions {
82
79
Force : true ,
83
- Hash : bestMatch .Hash (),
80
+ //Hash: bestMatch.Hash(),
81
+ Branch : bestMatch .Name (),
84
82
})
85
83
if err != nil {
86
84
msg .Die ("\t Error on switch to needed version from dependency: %s\n %s" , dep .Repository , err )
0 commit comments