commit 350efba7a8218ebaa7ee2bf8f07c78242d2a5a1c from: Stefan Sperling date: Sun May 20 12:18:12 2018 UTC fix diff display for last entry in tog log view commit - 917a23a3659efa22556a382b067e2b13738e2633 commit + 350efba7a8218ebaa7ee2bf8f07c78242d2a5a1c blob - ba91b30bb5e0d8adac6432dd7a58cbf9c3ee8f1d blob + a1ae0b112d7111e56f01ddcbafbcadb9b1533563 --- tog/tog.c +++ tog/tog.c @@ -556,16 +556,22 @@ static const struct got_error * show_commit(struct commit_queue_entry *entry, struct got_repository *repo) { const struct got_error *err; + struct commit_queue_entry *pentry; struct got_object *obj1 = NULL, *obj2 = NULL; err = got_object_open(&obj2, repo, entry->id); if (err) return err; - entry = TAILQ_NEXT(entry, entry); - if (entry) { - err = got_object_open(&obj1, repo, entry->id); + pentry = TAILQ_NEXT(entry, entry); + if (pentry == NULL) { + err = fetch_parent_commit(&pentry, entry, repo); if (err) + return err; + } + if (pentry) { + err = got_object_open(&obj1, repo, pentry->id); + if (err) goto done; }