Skip to content

Commit

Permalink
graph API: fix graph mis-alignment after uninteresting commits
Browse files Browse the repository at this point in the history
The graphing code had a bug that caused it to output branch lines
incorrectly after ignoring an uninteresting commit.  When computing how
to match up the branch lines from the current commit to the next one, it
forgot to take into account that it needed to initially start with 2
empty spaces where the missing commit would have gone.

So, instead of drawing this,

  | * | <- Commit with uninteresting parent
  |  /
  * |

It used to incorrectly draw this:

  | * | <- Commit with uninteresting parent
  * |

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Adam Simpkins authored and Junio C Hamano committed May 25, 2008
1 parent 182fb4d commit 2ecbd0a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ static void graph_insert_into_new_columns(struct git_graph *graph,
* Ignore uinteresting and pruned commits
*/
if (commit->object.flags & (UNINTERESTING | TREESAME))
{
*mapping_index += 2;
return;
}

/*
* If the commit is already in the new_columns list, we don't need to
Expand Down

0 comments on commit 2ecbd0a

Please sign in to comment.