about summary refs log tree commit homepage
path: root/lib/PublicInbox/SolverGit.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-09-02 10:11:47 +0000
committerEric Wong <e@80x24.org>2022-09-02 17:40:07 +0000
commit0d2dd565d44c068d641d25d6b4e8e2885af05a2d (patch)
treeab81c05c76ccd4908b4abc44fe34b4217c9d9985 /lib/PublicInbox/SolverGit.pm
parentdadbd6242ca19df6ce0d94d5bf65196cde13f6c6 (diff)
downloadpublic-inbox-0d2dd565d44c068d641d25d6b4e8e2885af05a2d.tar.gz
At least enough to get 66 patches applied to handle
/lore/all/34d644a519c/s/?b=target/arm/helper-mve.h
properly.

I noticed this bug due to a:
E: BUG: extra files in index: <100644 e91f526a1a83edb2b56798388a355b1c3729b4bd 0#011target/arm/translate-mve.c>
line in my syslog

However, the $TOTAL in "applying [X/$TOTAL]" in the debug log
is seems off...
Diffstat (limited to 'lib/PublicInbox/SolverGit.pm')
-rw-r--r--lib/PublicInbox/SolverGit.pm13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm
index 1e96d042..610bd65b 100644
--- a/lib/PublicInbox/SolverGit.pm
+++ b/lib/PublicInbox/SolverGit.pm
@@ -407,18 +407,17 @@ sub mark_found ($$$) {
 sub parse_ls_files ($$) {
         my ($self, $bref) = @_;
         my ($qsp_err, $di) = delete @$self{qw(-qsp_err -cur_di)};
-        die "git ls-files error:$qsp_err" if $qsp_err;
+        die "git ls-files -s -z error:$qsp_err" if $qsp_err;
 
-        my ($line, @extra) = split(/\0/, $$bref);
+        my @ls = split(/\0/, $$bref);
+        my ($line, @extra) = grep(/\t\Q$di->{path_b}\E\z/, @ls);
         scalar(@extra) and die "BUG: extra files in index: <",
-                                join('> <', @extra), ">";
-
+                                join('> <', $line, @extra), ">";
+        $line // die "no \Q$di->{path_b}\E in <",join('> <', @ls), '>';
         my ($info, $file) = split(/\t/, $line, 2);
         my ($mode_b, $oid_b_full, $stage) = split(/ /, $info);
-        if ($file ne $di->{path_b}) {
-                die
+        $file eq $di->{path_b} or die
 "BUG: index mismatch: file=$file != path_b=$di->{path_b}";
-        }
 
         my $tmp_git = $self->{tmp_git} or die 'no git working tree';
         my (undef, undef, $size) = $tmp_git->check($oid_b_full);