From 5a2324169e84e1402081422f1c1566816f0c2614 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 11 Aug 2016 03:24:34 -0300 Subject: [PATCH] eeshow/: properly handle fake history record for uncommitted changes --- eeshow/git-hist.c | 2 ++ eeshow/gui.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/eeshow/git-hist.c b/eeshow/git-hist.c index a016218..57c886d 100644 --- a/eeshow/git-hist.c +++ b/eeshow/git-hist.c @@ -229,6 +229,8 @@ char *vcs_git_long_for_pango(struct hist *h) const git_signature *sig; char *s; + if (!h->commit) + return stralloc("Uncommitted changes"); if (git_object_short_id(&buf, (git_object *) h->commit)) goto fail; commit_time = git_commit_time(h->commit); diff --git a/eeshow/gui.c b/eeshow/gui.c index d5ae252..31a50bf 100644 --- a/eeshow/gui.c +++ b/eeshow/gui.c @@ -1148,7 +1148,7 @@ static const struct sheet *parse_files(struct gui_hist *hist, bool libs_cached = 0; bool ok; - if (hist->vcs_hist) + if (hist->vcs_hist && hist->vcs_hist->commit) rev = vcs_git_get_rev(hist->vcs_hist); sch_init(&hist->sch_ctx, recurse);