X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=commit.c;h=fb02ba609b00d48a8e0e4c127cdc292a438bf9f3;hb=d5a6aafc90a14382120727e4e81ee1a380e8b194;hp=e867b86e6a10d64354226b04f71df98d7448e072;hpb=36d277c72d90d32f99616072b64a2652248f5264;p=git.git diff --git a/commit.c b/commit.c index e867b86e..fb02ba60 100644 --- a/commit.c +++ b/commit.c @@ -1,6 +1,6 @@ +#include "cache.h" #include "tag.h" #include "commit.h" -#include "cache.h" int save_commit_buffer = 1; @@ -560,6 +560,9 @@ void sort_in_topological_order(struct commit_list ** list) next = next->next; count++; } + + if (!count) + return; /* allocate an array to help sort the list */ nodes = xcalloc(count, sizeof(*nodes)); /* link the list to the array */