From 657ac9f89fad87c2790982029386bd720417e26f Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Mon, 25 Feb 2019 14:45:27 +0100 Subject: VREF/MAX_NEWBIN_SIZE does not handle deletion If a reference is deleted in a repository where this virtual ref is active, the script is not capable of handling it correctly: remote: fatal: bad object 0000000000000000000000000000000000000000 remote: error: unable to find 0000000000000000000000000000000000000000 remote: fatal: Not a valid object name 0000000000000000000000000000000000000000 This patch fixes the issue. [commit message and patch modified slightly by Sitaram] --- src/VREF/MAX_NEWBIN_SIZE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/VREF/MAX_NEWBIN_SIZE b/src/VREF/MAX_NEWBIN_SIZE index 84a9efa..99d51d3 100755 --- a/src/VREF/MAX_NEWBIN_SIZE +++ b/src/VREF/MAX_NEWBIN_SIZE @@ -21,6 +21,8 @@ die "not meant to be run manually" unless $ARGV[7]; my ( $newsha, $oldtree, $newtree, $refex, $max ) = @ARGV[ 2, 3, 4, 6, 7 ]; +exit 0 if $newsha eq '0000000000000000000000000000000000000000'; + # / (.*) +\| Bin 0 -> (\d+) bytes/ chomp( my $author_email = `git log --format=%ae -1 $newsha` ); -- cgit v1.2.3