gitgram/aitimemachine/git/t/t4070-diff-pairs.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

91 lines
2.3 KiB
Bash
Executable File

#!/bin/sh
test_description='basic diff-pairs tests'
. ./test-lib.sh
# This creates a diff with added, modified, deleted, renamed, copied, and
# typechange entries. This includes a submodule to test submodule diff support.
test_expect_success 'setup' '
test_config_global protocol.file.allow always &&
git init sub &&
test_commit -C sub initial &&
git init main &&
cd main &&
echo to-be-gone >deleted &&
echo original >modified &&
echo now-a-file >symlink &&
test_seq 200 >two-hundred &&
test_seq 201 500 >five-hundred &&
git add . &&
test_tick &&
git commit -m base &&
git tag base &&
git submodule add ../sub &&
echo now-here >added &&
echo new >modified &&
rm deleted &&
mkdir subdir &&
echo content >subdir/file &&
mv two-hundred renamed &&
test_seq 201 500 | sed s/300/modified/ >copied &&
rm symlink &&
git add -A . &&
test_ln_s_add dest symlink &&
test_tick &&
git commit -m new &&
git tag new
'
test_expect_success 'diff-pairs recreates --raw' '
git diff-tree -r -M -C -C -z base new >expect &&
git diff-pairs --raw -z >actual <expect &&
test_cmp expect actual
'
test_expect_success 'diff-pairs can create -p output' '
git diff-tree -p -M -C -C base new >expect &&
git diff-tree -r -M -C -C -z base new |
git diff-pairs -p -z >actual &&
test_cmp expect actual
'
test_expect_success 'diff-pairs does not support normal raw diff input' '
git diff-tree -r base new |
test_must_fail git diff-pairs >out 2>err &&
echo "usage: working without -z is not supported" >expect &&
test_must_be_empty out &&
test_cmp expect err
'
test_expect_success 'diff-pairs does not support tree objects as input' '
git diff-tree -z base new |
test_must_fail git diff-pairs -z >out 2>err &&
echo "fatal: tree objects not supported" >expect &&
test_must_be_empty out &&
test_cmp expect err
'
test_expect_success 'diff-pairs does not support pathspec arguments' '
git diff-tree -r -z base new |
test_must_fail git diff-pairs -z -- new >out 2>err &&
echo "usage: pathspec arguments not supported" >expect &&
test_must_be_empty out &&
test_cmp expect err
'
test_expect_success 'diff-pairs explicit queue flush' '
git diff-tree -r -M -C -C -z base new >expect &&
printf "\0" >>expect &&
git diff-tree -r -M -C -C -z base new >>expect &&
git diff-pairs --raw -z <expect >actual &&
test_cmp expect actual
'
test_done