Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t.sh
22 linesCodeBlameRaw

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

The plan says what g1t is for without measuring it against other products1import assert from "node:assert/strict";
2import { test } from "node:test";
3
4import { goImport } from "./go-get.ts";
5
6test("go get finds a repository's code from its address and any package in it", () => {
7 for (const path of ["/acme/lib", "/acme/lib/", "/acme/lib/pkg/sub", "/acme/lib.git"]) {
8 const page = goImport(new URL(`https://g1t.sh${path}?go-get=1`));
9 assert.ok(page, path);
10 assert.match(page, /<meta name="go-import" content="g1t\.sh\/acme\/lib git https:\/\/g1t\.sh\/acme\/lib\.git">/);
11 assert.match(page, /<meta name="go-source" content="g1t\.sh\/acme\/lib https:\/\/g1t\.sh\/acme\/lib /);
12 }
13});
14
15test("only go-get requests for a repository's address are answered", () => {
16 assert.equal(goImport(new URL("https://g1t.sh/acme/lib")), null, "no go-get");
17 assert.equal(goImport(new URL("https://g1t.sh/acme/lib?go-get=0")), null);
18 assert.equal(goImport(new URL("https://g1t.sh/acme?go-get=1")), null, "a workspace is not a module");
19 assert.equal(goImport(new URL("https://g1t.sh/acme/-/packages?go-get=1")), null, "workspace pages");
20 assert.equal(goImport(new URL("https://g1t.sh/Acme/lib?go-get=1")), null);
21 assert.equal(goImport(new URL("https://g1t.sh/acme/%22%3E?go-get=1")), null, "nothing is put in the page unchecked");
22});

This file's history is long; its oldest lines are credited to the oldest commit read.