# and if $want->[$item] is not true, the corresponding item may be undef
# and $parsedname is only valid if $spec is not undef
# (say $spec { } if you want the name parsed but no restrictions)
+ my @want = @$want;
+ $want[0] ||= !$deleted_ok;
run_git(sub {
debug("foreach_patch considering $_");
m/ / or die "$_ ?";
my $objname = $`;
my @out;
my $patch = substr($',19); #');
- $want->[0] ||= !$deleted_ok;
+ my $wantix = 0;
foreach my $file (qw(flags deps pflags included)) {
if ($file eq 'deps') {
}
}
- if (!shift @$want) {
+ if (!$want[$wantix++]) {
push @out, undef;
next;
}
push @out, \%data;
}
- debug("foreach_patch YES @out"), return
+ debug("foreach_patch YES ".(join '', map { 0+defined } @out)), return
$body->($patch, @out);
},
qw(for-each-ref --format), '%(objectname) %(refname)',
#----- selection -----
if ($leaves) {
+ debug("leaves");
foreach my $p (keys %patches) {
+ debug("leaves $p");
my $v = $patches{$p};
next if $v->{Info}[0]{Deleted};
foreach my $dep (keys %{ $v->{Info}[1] }) {
+ debug("leaves $p $dep");
next unless exists $patches{$dep};
$patches{$dep}{NotLeaf} = 1;
}