From: Jonas Fonseca Date: Tue, 3 Feb 2009 21:34:44 +0000 (+0100) Subject: Tree view: improve handling of empty trees X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b63b625096f59fc0bf9ea75ddf31380110790034;p=tig.git Tree view: improve handling of empty trees --- diff --git a/NEWS b/NEWS index 7f8e98e..733c98b 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,7 @@ Improvements: Bug fixes: - Tree view: fix memory corruption bug when updating. + - Tree view: improve handling of empty trees. - Status view: fix reverting of unmerged files. - Fix regression for non-UTF-8 locales corrupting the view data. - Fix regression parsing multiple spaces in ~/.tigrc. diff --git a/tig.c b/tig.c index 27563e1..cba101c 100644 --- a/tig.c +++ b/tig.c @@ -3849,6 +3849,12 @@ tree_read_date(struct view *view, char *text, bool *read_date) }; struct io io = {}; + if (!view->lines) { + tree_entry(view, LINE_TREE_PARENT, opt_path, NULL, NULL); + report("Tree is empty"); + return TRUE; + } + if (!run_io_rd(&io, log_file, FORMAT_NONE)) { report("Failed to load tree data"); return TRUE;