File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -1175,6 +1175,7 @@ int graph_next_line(struct git_graph *graph, struct strbuf *sb)
1175
1175
static void graph_padding_line (struct git_graph * graph , struct strbuf * sb )
1176
1176
{
1177
1177
int i ;
1178
+ int chars_written = 0 ;
1178
1179
1179
1180
if (graph -> state != GRAPH_COMMIT ) {
1180
1181
graph_next_line (graph , sb );
@@ -1190,14 +1191,21 @@ static void graph_padding_line(struct git_graph *graph, struct strbuf *sb)
1190
1191
*/
1191
1192
for (i = 0 ; i < graph -> num_columns ; i ++ ) {
1192
1193
struct column * col = & graph -> columns [i ];
1194
+
1193
1195
strbuf_write_column (sb , col , '|' );
1194
- if (col -> commit == graph -> commit && graph -> num_parents > 2 )
1195
- strbuf_addchars (sb , ' ' , (graph -> num_parents - 2 ) * 2 );
1196
- else
1196
+ chars_written ++ ;
1197
+
1198
+ if (col -> commit == graph -> commit && graph -> num_parents > 2 ) {
1199
+ int len = (graph -> num_parents - 2 ) * 2 ;
1200
+ strbuf_addchars (sb , ' ' , len );
1201
+ chars_written += len ;
1202
+ } else {
1197
1203
strbuf_addch (sb , ' ' );
1204
+ chars_written ++ ;
1205
+ }
1198
1206
}
1199
1207
1200
- graph_pad_horizontally (graph , sb , graph -> num_columns );
1208
+ graph_pad_horizontally (graph , sb , chars_written );
1201
1209
1202
1210
/*
1203
1211
* Update graph->prev_state since we have output a padding line
You can’t perform that action at this time.
0 commit comments