@@ -43,6 +43,11 @@ print an extended status output for each dependency of the project.
43
43
Status returns exit code zero if all dependencies are in a "good state".
44
44
`
45
45
46
+ const (
47
+ shortRev = iota
48
+ longRev = iota
49
+ )
50
+
46
51
var (
47
52
errFailedUpdate = errors .New ("failed to fetch updates" )
48
53
errFailedListPkg = errors .New ("failed to list packages" )
@@ -104,7 +109,7 @@ func (out *tableOutput) BasicLine(bs *BasicStatus) {
104
109
bs .getConsolidatedConstraint (),
105
110
formatVersion (bs .Version ),
106
111
formatVersion (bs .Revision ),
107
- bs .getConsolidatedLatest (),
112
+ bs .getConsolidatedLatest (shortRev ),
108
113
bs .PackageCount ,
109
114
)
110
115
}
@@ -308,10 +313,15 @@ func (bs *BasicStatus) getConsolidatedVersion() string {
308
313
return version
309
314
}
310
315
311
- func (bs * BasicStatus ) getConsolidatedLatest () string {
316
+ func (bs * BasicStatus ) getConsolidatedLatest (revSize int ) string {
312
317
latest := ""
313
318
if bs .Latest != nil {
314
- latest = formatVersion (bs .Latest )
319
+ switch revSize {
320
+ case shortRev :
321
+ latest = formatVersion (bs .Latest )
322
+ case longRev :
323
+ latest = bs .Latest .String ()
324
+ }
315
325
}
316
326
317
327
if bs .hasError {
@@ -326,8 +336,8 @@ func (bs *BasicStatus) marshalJSON() *rawStatus {
326
336
ProjectRoot : bs .ProjectRoot ,
327
337
Constraint : bs .getConsolidatedConstraint (),
328
338
Version : formatVersion (bs .Version ),
329
- Revision : formatVersion (bs .Revision ),
330
- Latest : bs .getConsolidatedLatest (),
339
+ Revision : string (bs .Revision ),
340
+ Latest : bs .getConsolidatedLatest (longRev ),
331
341
PackageCount : bs .PackageCount ,
332
342
}
333
343
}
0 commit comments