X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=show-branch.c;h=8cc0755e0af511fd2151daeaceb7bcd5a7ec28b3;hb=acfadcfb48e34fdc441e9cffbb385fce9693b363;hp=262acf5cefc8053a012b2251bfbfb86177f80a90;hpb=c9d023b2a63ef233c63e1b8f95aabac74362719d;p=git.git diff --git a/show-branch.c b/show-branch.c index 262acf5c..8cc0755e 100644 --- a/show-branch.c +++ b/show-branch.c @@ -196,8 +196,11 @@ static void show_one_commit(struct commit *commit) { char pretty[128], *cp; struct commit_name *name = commit->object.util; - pretty_print_commit(CMIT_FMT_ONELINE, commit->buffer, ~0, - pretty, sizeof(pretty)); + if (commit->object.parsed) + pretty_print_commit(CMIT_FMT_ONELINE, commit->buffer, ~0, + pretty, sizeof(pretty)); + else + strcpy(pretty, "(unavailable)"); if (!strncmp(pretty, "[PATCH] ", 8)) cp = pretty + 8; else