gitgram/aitimemachine/git/t/t5330-no-lazy-fetch-with-commit-graph.sh
caelum0x 49b183818c Unify gitgram + aitimemachine into the monorepo (de-submodule) and merge vendored engines
Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as
opaque submodule gitlinks on GitHub) into fully-tracked first-party content.

AITM now merges its 7 vendored repos as first-party engines:
- memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts
- git: vendored C git (bundled binary) + gitnexus (in-process code intelligence)
- agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess)

Includes the full session's product build: Gitgram web/mobile/backend features,
AITM website/CLI/MCP, the unified memory layer, engine build tooling
(scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md),
and extensive test suites.

Build artifacts, node_modules, external/, and gemini-cli are gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:14:09 +03:00

48 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
test_description='test for no lazy fetch with the commit-graph'
. ./test-lib.sh
test_expect_success 'setup: prepare a repository with a commit' '
git init with-commit &&
test_commit -C with-commit the-commit &&
oid=$(git -C with-commit rev-parse HEAD)
'
test_expect_success 'setup: prepare a repository with commit-graph contains the commit' '
git init with-commit-graph &&
echo "$(pwd)/with-commit/.git/objects" \
>with-commit-graph/.git/objects/info/alternates &&
# create a ref that points to the commit in alternates
git -C with-commit-graph update-ref refs/ref_to_the_commit "$oid" &&
# prepare some other objects to commit-graph
test_commit -C with-commit-graph something &&
git -c gc.writeCommitGraph=true -C with-commit-graph gc &&
test_path_is_file with-commit-graph/.git/objects/info/commit-graph
'
test_expect_success 'setup: change the alternates to what without the commit' '
git init --bare without-commit &&
git -C with-commit-graph cat-file -e $oid &&
echo "$(pwd)/without-commit/objects" \
>with-commit-graph/.git/objects/info/alternates &&
test_must_fail git -C with-commit-graph cat-file -e $oid
'
test_expect_success 'fetch any commit from promisor with the usage of the commit graph' '
# setup promisor and prepare any commit to fetch
git -C with-commit-graph remote add origin "$(pwd)/with-commit" &&
git -C with-commit-graph config remote.origin.promisor true &&
git -C with-commit-graph config remote.origin.partialclonefilter blob:none &&
test_commit -C with-commit any-commit &&
anycommit=$(git -C with-commit rev-parse HEAD) &&
test_must_fail env GIT_TRACE="$(pwd)/trace.txt" \
git -C with-commit-graph fetch origin $anycommit 2>err &&
test_grep ! "fatal: promisor-remote: unable to fork off fetch subprocess" err &&
grep "git fetch origin" trace.txt >actual &&
test_line_count = 1 actual
'
test_done