зеркало из https://github.com/golang/dep.git
Fix how dep status print revision constraints
Before this fix revision constraints would be printed as an Any constraint ("*") instead of as the revision itself.
This commit is contained in:
Родитель
ef6a28f70b
Коммит
dae0e9d6e9
|
@ -486,12 +486,16 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
|
|||
if pp, has := p.Manifest.Ovr[proj.Ident().ProjectRoot]; has && pp.Constraint != nil {
|
||||
bs.hasOverride = true
|
||||
bs.Constraint = pp.Constraint
|
||||
} else {
|
||||
if pp, has := p.Manifest.Constraints[proj.Ident().ProjectRoot]; has && pp.Constraint != nil {
|
||||
bs.Constraint = pp.Constraint
|
||||
} else {
|
||||
bs.Constraint = gps.Any()
|
||||
for _, c := range cm[bs.ProjectRoot] {
|
||||
bs.Constraint = c.Constraint.Intersect(bs.Constraint)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Only if we have a non-rev and non-plain version do/can we display
|
||||
// anything wrt the version's updateability.
|
||||
|
|
|
@ -187,6 +187,13 @@ func TestBasicStatusGetConsolidatedConstraint(t *testing.T) {
|
|||
},
|
||||
wantConstraint: "1.2.1 (override)",
|
||||
},
|
||||
{
|
||||
name: "BasicStatus with Revision Constraint",
|
||||
basicStatus: BasicStatus{
|
||||
Constraint: gps.Revision("ddeb6f5d27091ff291b16232e99076a64fb375b8"),
|
||||
},
|
||||
wantConstraint: "ddeb6f5",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
|
|
Загрузка…
Ссылка в новой задаче