summaryrefslogtreecommitdiff
path: root/file
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-27 09:05:31 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-08-27 14:19:25 (GMT)
commitdc134144503f58e0f2eca6e557f5276038e95cae (patch)
tree490ba22aef6cbbcb06c9d6c0759839c4da32ab42 /file
parentbfc763f768a4d9c1e0998669d796ee9cae057264 (diff)
downloadeeshow-dc134144503f58e0f2eca6e557f5276038e95cae.zip
eeshow-dc134144503f58e0f2eca6e557f5276038e95cae.tar.gz
eeshow-dc134144503f58e0f2eca6e557f5276038e95cae.tar.bz2
file/git-hist.c (dump_hist): use hist_iterate
This way, we can be sure everything uses the same algorithm.
Diffstat (limited to 'file')
-rw-r--r--file/git-hist.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/file/git-hist.c b/file/git-hist.c
index a4c1776..fa0e911 100644
--- a/file/git-hist.c
+++ b/file/git-hist.c
@@ -235,10 +235,9 @@ void hist_iterate(struct hist *h,
}
-void dump_hist(struct hist *h)
+static void dump_one(void *user, struct hist *h)
{
git_buf buf = { 0 };
- unsigned i;
if (h->commit) {
if (git_object_short_id(&buf, (git_object *) h->commit))
@@ -249,8 +248,10 @@ void dump_hist(struct hist *h)
} else {
printf("dirty\n");
}
+}
- for (i = 0; i != h->n_older; i++)
- if (h->older[i]->newer[h->older[i]->n_newer - 1] == h)
- dump_hist(h->older[i]);
+
+void dump_hist(struct hist *h)
+{
+ hist_iterate(h, dump_one, NULL);
}