Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git

Captures file handle depth

AuthorDave Jarvis <email>
Date2026-02-09 19:55:08 GMT-0800
Commitc86aa39a370c0821d5161ba757fcf2cf07134628
Parentca6feda
Git.php
private function isTreeData( string $data ): bool {
$result = false;
- $pattern = '/^(40000|100644|100755|120000) /';
+ $pattern = '/^(40000|100644|100755|120000|160000) /';
if( strlen( $data ) >= 25 && preg_match( $pattern, $data ) ) {
$negOffset = (($negOffset + 1) << 7) | ($byte & 127);
}
+
+ // Capture the current position (start of delta data)
+ $currentPos = ftell( $fileHandle );
+ // Recursive call moves the file pointer
$base = $this->readPackEntry( $fileHandle, $offset - $negOffset );
+
+ // Restore the position to read the delta data
+ fseek( $fileHandle, $currentPos );
+
$delta = @gzuncompress( fread( $fileHandle, self::MAX_READ ) ) ?: '';
Delta9 lines added, 1 line removed, 8-line increase