DisplayChangesForPush will display the set of changes via DisplayChangeForPush in the order given.
(changeSet []Change)
| 71 | // DisplayChangesForPush will display the set of changes via |
| 72 | // DisplayChangeForPush in the order given. |
| 73 | func (ui *UI) DisplayChangesForPush(changeSet []Change) error { |
| 74 | if len(changeSet) == 0 { |
| 75 | return nil |
| 76 | } |
| 77 | |
| 78 | var columnWidth int |
| 79 | for _, change := range changeSet { |
| 80 | if width := wordSize(ui.TranslateText(change.Header)); width > columnWidth { |
| 81 | columnWidth = width |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | for _, change := range changeSet { |
| 86 | padding := columnWidth - wordSize(ui.TranslateText(change.Header)) + 3 |
| 87 | err := ui.DisplayChangeForPush(change.Header, padding, change.HiddenValue, change.CurrentValue, change.NewValue) |
| 88 | if err != nil { |
| 89 | return err |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | return nil |
| 94 | } |
| 95 | |
| 96 | func (ui UI) displayDiffForInt(offset string, header string, oldValue int, newValue int) { |
| 97 | if oldValue != newValue { |
nothing calls this directly
no test coverage detected