graph: handle line padding in `graph_next_line()`
authorJames Coglan <jcoglan@gmail.com>
Tue, 15 Oct 2019 23:47:48 +0000 (23:47 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Oct 2019 02:11:24 +0000 (11:11 +0900)
commit210179a20d585f6a96e0963db69790e590bd9433
tree1beb3ed2ca8e062a7cc0425c481599e27a691e82
parentfbccf255f9449c2f617d875ebf78b9f1730fae5d
graph: handle line padding in `graph_next_line()`

Now that the display width of graph lines is implicitly tracked via the
`graph_line` interface, the calls to `graph_pad_horizontally()` no
longer need to be located inside the individual output functions, where
the character counting was previously being done.

All the functions called by `graph_next_line()` generate a line of
output, then call `graph_pad_horizontally()`, and finally change the
graph state if necessary. As padding is the final change to the output
done by all these functions, it can be removed from all of them and done
in `graph_next_line()` instead.

I've also moved the guard in `graph_output_padding_line()` that checks
the graph has a commit; this function is only called by
`graph_next_line()` and we must not pad the `graph_line` if no commit is
set.

Signed-off-by: James Coglan <jcoglan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
graph.c