File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/NerdBank.GitVersioning/ManagedGit Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 5
5
using System . Buffers ;
6
6
using System . IO ;
7
7
using System . IO . Compression ;
8
+ using System . Linq ;
8
9
using System . Threading ;
9
10
using System . Threading . Tasks ;
10
11
@@ -56,9 +57,9 @@ public ZLibStream(Stream stream, long length = -1)
56
57
Span < byte > zlibHeader = stackalloc byte [ 2 ] ;
57
58
stream . ReadAll ( zlibHeader ) ;
58
59
59
- if ( zlibHeader [ 0 ] != 0x78 || ( zlibHeader [ 1 ] != 0x01 && zlibHeader [ 1 ] != 0x9C ) )
60
+ if ( zlibHeader [ 0 ] != 0x78 || ( zlibHeader [ 1 ] != 0x01 && zlibHeader [ 1 ] != 0x9C && zlibHeader [ 1 ] != 0x5E && zlibHeader [ 1 ] != 0xDA ) )
60
61
{
61
- throw new GitException ( ) ;
62
+ throw new GitException ( $ "Invalid zlib header { string . Join ( " " , zlibHeader . ToArray ( ) . Select ( b => $ " { b : X2 } " ) ) } " ) ;
62
63
}
63
64
}
64
65
You can’t perform that action at this time.
0 commit comments