uniq list for changed hook
authorJoey Hess <joey@kitenet.net>
Mon, 2 Apr 2012 17:50:58 +0000 (13:50 -0400)
committerJoey Hess <joey@kitenet.net>
Mon, 2 Apr 2012 17:50:58 +0000 (13:50 -0400)
There can be dups when eg, adding a new internal page, apparently.

IkiWiki/Render.pm

index 5b461611d3ae66c262e016096a1ca5061fb53984..d6c1f4f4c5ec685ff0cfefcb4c6f7db81163e786 100644 (file)
@@ -832,10 +832,10 @@ sub refresh () {
                run_hooks(rendered => sub { shift->(keys %rendered) });
                run_hooks(change => sub { shift->(keys %rendered) }); # back-compat
        }
-       run_hooks(changes => sub {
-               shift->(@$new, @$changed, @$del,
-                       @$internal_new, @$internal_changed, @$internal_del);
-       });
+       my %all_changed = map { $_ => 1 }
+               @$new, @$changed, @$del,
+               @$internal_new, @$internal_changed, @$internal_del;
+       run_hooks(changes => sub { shift->(keys %all_changed) });
 }
 
 sub clean_rendered {