From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 9F0C121426 for ; Mon, 21 Jan 2019 20:52:56 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 13/37] git: support 'ambiguous' result from --batch-check Date: Mon, 21 Jan 2019 20:52:29 +0000 Message-Id: <20190121205253.10455-14-e@80x24.org> In-Reply-To: <20190121205253.10455-1-e@80x24.org> References: <20190121205253.10455-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index b655921..a0b934a 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -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); -- EW