summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gerbet <thomas.gerbet@enalean.com>2019-02-25 14:45:27 +0100
committerSitaram Chamarty <sitaramc@gmail.com>2019-03-03 15:57:51 +0530
commit657ac9f89fad87c2790982029386bd720417e26f (patch)
treea881df01df9e7b69098bb529f39a8dde5b610343
parent37dfce9376104f0bf790e36850680c380783ac09 (diff)
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]
-rwxr-xr-xsrc/VREF/MAX_NEWBIN_SIZE2
1 files changed, 2 insertions, 0 deletions
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` );