chiark / gitweb /
git-debrebase: walk: Move $read_tree_upstream into the loop
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Aug 2018 18:03:41 +0000 (19:03 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Aug 2018 18:03:41 +0000 (19:03 +0100)
NFC.

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

index 482c432..24aefbe 100755 (executable)
@@ -1423,11 +1423,6 @@ sub walk ($;$$$) {
 
     my $rewriting = 0;
 
-    my $read_tree_upstream = sub {
-       my ($treeish) = @_;
-       read_tree_upstream $treeish, 0, $build;
-    };
-
     $#upp_cl = $upp_limit if defined $upp_limit;
  
     my $committer_authline = calculate_committer_authline();
@@ -1440,6 +1435,12 @@ sub walk ($;$$$) {
        mkdir $rd or $!==EEXIST or die $!;
        my $current_method;
        runcmd @git, qw(read-tree), $build;
+
+       my $read_tree_upstream = sub {
+           my ($treeish) = @_;
+           read_tree_upstream $treeish, 0, $build;
+       };
+
        foreach my $cl (qw(Debian), (reverse @brw_cl),
                        { SpecialMethod => 'RecordBreakwaterTip' },
                        qw(Upstream), (reverse @upp_cl)) {