chiark / gitweb /
git-debrebase: trees_diff_walk: Refactor $all to \%opts
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 24 Aug 2018 18:56:12 +0000 (19:56 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 24 Aug 2018 18:56:12 +0000 (19:56 +0100)
No callers pass this so NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index 4bfe0952518214203c5e3ac397b27c53ceb93354..7629a148b6acf32f686865a7410a33c9ad44f8ac 100755 (executable)
@@ -225,12 +225,14 @@ sub get_tree ($;$$) {
 }
 
 sub trees_diff_walk ($$$;$) {
-    # trees_diff_walk [$all,] $x, $y, sub {... }
-    # calls sub->($name, $ix, $iy) for each difference (with $all, each name)
+    # trees_diff_walk [{..opts...},] $x, $y, sub {... }
+    # calls sub->($name, $ix, $iy) for each difference
     # $x and $y are as for get_tree
     # where $name, $ix, $iy are $name and $info from get_tree
-    my $all = shift @_ if @_>=4;
+    # opts are   all       call even for names same in both
+    my $opts = shift @_ if @_>=4;
     my ($x,$y,$call) = @_;
+    my $all = $opts->{all};
     return if !$all and $x eq $y;
     my @x = get_tree $x;
     my @y = get_tree $y;