@@ -57,7 +57,7 @@ func (payload *SafeWriterPayload) HasVendor() bool {
57
57
type LockDiff struct {
58
58
HashDiff * StringDiff
59
59
Add []LockedProjectDiff
60
- Remove []gps. ProjectRoot
60
+ Remove []LockedProjectDiff
61
61
Modify []LockedProjectDiff
62
62
}
63
63
@@ -111,12 +111,12 @@ func (diff *LockDiff) Format() (string, error) {
111
111
// Fields are only populated when there is a difference, otherwise they are empty.
112
112
// TODO(carolynvs) this should be moved to gps
113
113
type LockedProjectDiff struct {
114
- Name gps.ProjectRoot `json:"name"`
114
+ Name gps.ProjectRoot `json:"name"`
115
115
Source * StringDiff `json:"repo,omitempty"`
116
- Version * StringDiff `json:"version,omitempty"`
117
- Branch * StringDiff `json:"branch,omitempty"`
118
- Revision * StringDiff `json:"revision,omitempty"`
119
- Packages []StringDiff `json:"packages,omitempty"`
116
+ Version * StringDiff `json:"version,omitempty"`
117
+ Branch * StringDiff `json:"branch,omitempty"`
118
+ Revision * StringDiff `json:"revision,omitempty"`
119
+ Packages []StringDiff `json:"packages,omitempty"`
120
120
}
121
121
122
122
type StringDiff struct {
@@ -438,7 +438,7 @@ func diffLocks(l1 gps.Lock, l2 gps.Lock) *LockDiff {
438
438
}
439
439
i2next = i2 + 1 // Don't evaluate to this again
440
440
case - 1 : // Found a new project
441
- add := buildAddProject (lp2 )
441
+ add := buildLockedProjectDiff (lp2 )
442
442
diff .Add = append (diff .Add , add )
443
443
i2next = i2 + 1 // Don't evaluate to this again
444
444
continue // Keep looking for a matching project
@@ -450,14 +450,15 @@ func diffLocks(l1 gps.Lock, l2 gps.Lock) *LockDiff {
450
450
}
451
451
452
452
if ! matched {
453
- diff .Remove = append (diff .Remove , pr1 )
453
+ remove := buildLockedProjectDiff (lp1 )
454
+ diff .Remove = append (diff .Remove , remove )
454
455
}
455
456
}
456
457
457
458
// Anything that still hasn't been evaluated are adds
458
459
for i2 := i2next ; i2 < len (p2 ); i2 ++ {
459
460
lp2 := p2 [i2 ]
460
- add := buildAddProject (lp2 )
461
+ add := buildLockedProjectDiff (lp2 )
461
462
diff .Add = append (diff .Add , add )
462
463
}
463
464
@@ -467,7 +468,7 @@ func diffLocks(l1 gps.Lock, l2 gps.Lock) *LockDiff {
467
468
return & diff
468
469
}
469
470
470
- func buildAddProject (lp gps.LockedProject ) LockedProjectDiff {
471
+ func buildLockedProjectDiff (lp gps.LockedProject ) LockedProjectDiff {
471
472
r2 , b2 , v2 := getVersionInfo (lp .Version ())
472
473
var rev , version , branch * StringDiff
473
474
if r2 != "" {
0 commit comments