]> Sergey Matveev's repositories - public-inbox.git/commitdiff
git: support 'ambiguous' result from --batch-check
authorEric Wong <e@80x24.org>
Sat, 19 Jan 2019 06:36:04 +0000 (06:36 +0000)
committerEric Wong <e@80x24.org>
Sun, 20 Jan 2019 04:24:54 +0000 (04:24 +0000)
David Turner's patch to return "ambiguous" seems like a reasonable
patch for future versions of git:

https://public-inbox.org/git/672a6fb9e480becbfcb5df23ae37193784811b6b.camel@novalis.org/

lib/PublicInbox/Git.pm

index b655921b00f06e1ef3be428901b1919abe2fbeba..a0b934a312d508cba5175eb439eaa1841358f936 100644 (file)
@@ -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);