]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Git.pm
solver: hold patches in temporary directory
[public-inbox.git] / lib / PublicInbox / Git.pm
index b655921b00f06e1ef3be428901b1919abe2fbeba..3ad08112e4d6f6c6237786928d0f3b768af038fb 100644 (file)
@@ -50,7 +50,7 @@ sub new {
        my ($class, $git_dir) = @_;
        my @st;
        $st[7] = $st[10] = 0;
-       # may contain {-wt} field (working-tree (File::Temp::Dir))
+       # may contain {-tmp} field for File::Temp::Dir
        bless { git_dir => $git_dir, st => \@st }, $class
 }
 
@@ -179,11 +179,13 @@ sub check {
        local $/ = "\n";
        chomp(my $line = $self->{in_c}->getline);
        my ($hex, $type, $size) = split(' ', $line);
-       return if $type eq 'missing';
 
-       # "dead" in git.git shows "dangling 4\ndead\n", not sure why
-       # https://public-inbox.org/git/20190118033845.s2vlrb3wd3m2jfzu@dcvr/
-       # so handle the oddball stuff just in case
+       # Future versions of git.git may show 'ambiguous', but for now,
+       # we must handle 'dangling' below (and maybe some other oddball
+       # stuff):
+       # https://public-inbox.org/git/20190118033845.s2vlrb3wd3m2jfzu@dcvr/T/
+       return if $type eq 'missing' || $type eq 'ambiguous';
+
        if ($hex eq 'dangling' || $hex eq 'notdir' || $hex eq 'loop') {
                $size = $type + length("\n");
                my $r = read($self->{in_c}, my $buf, $size);