Dave Jarvis' Repositories

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

Attempts to fix cloning

AuthorDave Jarvis <email>
Date2026-02-16 01:42:21 GMT-0800
Commit1badb5a577c3ab0ee6527a64044a711adfd226d9
Parent6e23b75
Router.php
}
- if( $repoPath ) {
- $this->git->setRepository( $repoPath );
- $subPath = implode( '/', $parts );
- return new ClonePage( $this->git, $subPath );
+ if( !$repoPath ) {
+ http_response_code( 404 );
+ echo "Repository not found";
+ exit;
}
+
+ $this->git->setRepository( $repoPath );
+ $subPath = implode( '/', $parts );
+ return new ClonePage( $this->git, $subPath );
}
pages/ClonePage.php
public function render() {
if( $this->subPath === '' ) {
- if( $_SERVER['REQUEST_METHOD'] === 'POST' ) {
- $this->handleUploadPack();
- return;
- }
-
$this->redirectBrowser();
return;
}
- if( $this->subPath === 'git-receive-pack' ) {
+ if( str_ends_with( $this->subPath, 'git-receive-pack' ) ) {
http_response_code( 403 );
echo "Read-only repository.";
$refs[] = ['ref' => $ref, 'sha' => $sha];
} );
+
+ $caps = "multi_ack thin-pack side-band side-band-64k ofs-delta shallow no-progress include-tag";
if( !empty( $refs ) ) {
- $caps = "multi_ack thin-pack side-band side-band-64k ofs-delta shallow no-progress include-tag";
$this->packetWrite( $refs[0]['sha'] . " " . $refs[0]['ref'] . "\0" . $caps . "\n" );
for( $i = 1; $i < count( $refs ); $i++ ) {
$this->packetWrite( $refs[$i]['sha'] . " " . $refs[$i]['ref'] . "\n" );
}
} else {
- $this->packetWrite( "0000000000000000000000000000000000000000 capabilities^{}\0$caps\n" );
+ $this->packetWrite( "0000000000000000000000000000000000000000 capabilities^{}\0" . $caps . "\n" );
}
Delta12 lines added, 12 lines removed