зеркало из 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
|
@ -487,9 +487,13 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
|
|||
bs.hasOverride = true
|
||||
bs.Constraint = pp.Constraint
|
||||
} else {
|
||||
bs.Constraint = gps.Any()
|
||||
for _, c := range cm[bs.ProjectRoot] {
|
||||
bs.Constraint = c.Constraint.Intersect(bs.Constraint)
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче