summaryrefslogtreecommitdiff
path: root/gui/gui.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-27 14:31:09 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-27 14:31:09 -0300
commit51a4e4d928c2ab9563e3ab62a68d20a9f5de7b5c (patch)
tree89302eb49f2b32b8a9b0d1eeedfb28f871d42bb8 /gui/gui.c
parentb50be73df03140fd263119d39545b58d6954b561 (diff)
downloadeeshow-51a4e4d928c2ab9563e3ab62a68d20a9f5de7b5c.tar.gz
eeshow-51a4e4d928c2ab9563e3ab62a68d20a9f5de7b5c.tar.bz2
eeshow-51a4e4d928c2ab9563e3ab62a68d20a9f5de7b5c.zip
file/git-hist.c: introduce history descriptor to API, removing global "history"
This will be used for more things in the future.
Diffstat (limited to 'gui/gui.c')
-rw-r--r--gui/gui.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gui/gui.c b/gui/gui.c
index f203f6c..8cb17d8 100644
--- a/gui/gui.c
+++ b/gui/gui.c
@@ -391,8 +391,9 @@ static void get_revisions(struct gui *gui, const struct file_names *fn,
.limit = limit ? limit < 0 ? -limit : limit : -1,
};
- if (gui->vcs_hist)
- hist_iterate(gui->vcs_hist, add_hist, &add_hist_ctx);
+ if (gui->vcs_history)
+ hist_iterate(gui->vcs_history, vcs_head(gui->vcs_history),
+ add_hist, &add_hist_ctx);
else
add_hist(&add_hist_ctx, NULL);
}
@@ -412,15 +413,16 @@ static void count_history(void *user, struct hist *h)
static void get_history(struct gui *gui, const char *sch_name, int limit)
{
if (!vcs_git_try(sch_name)) {
- gui->vcs_hist = NULL;
+ gui->vcs_history = NULL;
return;
}
- gui->vcs_hist = vcs_git_hist(sch_name);
+ gui->vcs_history = vcs_git_history(sch_name);
if (limit)
gui->hist_size = limit > 0 ? limit : -limit;
else
- hist_iterate(gui->vcs_hist, count_history, gui);
+ hist_iterate(gui->vcs_history, vcs_head(gui->vcs_history),
+ count_history, gui);
}
@@ -448,7 +450,7 @@ int run_gui(const struct file_names *fn, bool recurse, int limit)
struct gui gui = {
.scale = 1 / 16.0,
.hist = NULL,
- .vcs_hist = NULL,
+ .vcs_history = NULL,
.mode = showing_sheet,
.sheet_overlays = NULL,
.hist_overlays = NULL,