Persistent store with Git semantics: lazy reads, delayed writes, content-addressing
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

irmin/test/cram: add info.t and tree.t for CLI coverage

info.t exercises [irmin info] against a real repo: store-level output
(backend / branch / list), file-level output (size), and scrubs the
sandbox path out of the [Store:] / [File:] lines. Leaves the column
alignment intact on purpose — it's a visible contract.

tree.t exercises [irmin tree]: root-level recursive listing, subpath
listing, JSON output per entry, and the "path not found" non-zero
exit.

Both follow the skill: directory-form [.t/run.t], literal expected
output with a sed scrubber for the one path-dependent line, no glob/
regex patterns.

+83
+32
test/cram/info.t/run.t
··· 1 + irmin info - show store or file information 2 + 3 + With no argument, [info] reports on the current repository: store path, 4 + backend, default branch, and branch list. With a file argument, it 5 + reports on the file (size, plus CAR metadata when the extension is 6 + [.car]). 7 + 8 + Set up a small Git-backed repository with two branches: 9 + 10 + $ mkdir testrepo 11 + $ cd testrepo 12 + $ irmin init . 2>&1 > /dev/null 13 + $ irmin set README.md '# Hello' -m 'init' 2>&1 > /dev/null 14 + $ irmin checkout -c feature 2>&1 > /dev/null 15 + 16 + Store-level info. The [Store:] path is scrubbed because it contains 17 + the sandbox cwd: 18 + 19 + $ irmin info | sed "s|Store:.*|Store: PATH|" 20 + Store: PATH 21 + Backend: git 22 + Branch: main 23 + Branches: 2 24 + feature 25 + main 26 + 27 + File-level info on a plain text file just shows size: 28 + 29 + $ echo 'hi' > plain.txt 30 + $ irmin info plain.txt | sed "s|File:.*|File: PATH|" 31 + File: PATH 32 + Size: 3 bytes
+51
test/cram/tree.t/run.t
··· 1 + irmin tree - show the branch tree as a nested listing 2 + 3 + [tree] walks the current branch from the root (or from an optional 4 + subpath argument), printing every file and directory with indentation 5 + that mirrors the nesting depth. Directories are marked with a trailing 6 + slash and coloured blue on a TTY; we run with [TERM=dumb] so the 7 + output is plain text. 8 + 9 + Set up a repository with a nested layout: 10 + 11 + $ mkdir testrepo 12 + $ cd testrepo 13 + $ irmin init . 2>&1 > /dev/null 14 + $ irmin set README.md 'top-level' -m c1 2>&1 > /dev/null 15 + $ irmin set src/a.ml 'let a = ()' -m c2 2>&1 > /dev/null 16 + $ irmin set src/sub/b.ml 'let b = ()' -m c3 2>&1 > /dev/null 17 + $ irmin set docs/intro.md '# Intro' -m c4 2>&1 > /dev/null 18 + 19 + Full tree from the root. Files are listed flat at their level; directory 20 + names carry the trailing slash and are indented one extra step for each 21 + nested directory: 22 + 23 + $ irmin tree 24 + README.md 25 + docs/ 26 + intro.md 27 + src/ 28 + a.ml 29 + sub/ 30 + b.ml 31 + 32 + Subtree starting at [src/] — anything above src/ is hidden: 33 + 34 + $ irmin tree src 35 + a.ml 36 + sub/ 37 + b.ml 38 + 39 + JSON output gives one object per entry with a [type] discriminator. 40 + Order matches the human output: 41 + 42 + $ irmin tree -o json src 43 + {"path":"a.ml","type":"file"} 44 + {"path":"sub","type":"dir"} 45 + {"path":"sub/b.ml","type":"file"} 46 + 47 + Unknown path exits non-zero and prints an error line: 48 + 49 + $ irmin tree nonexistent 50 + ✗ Path nonexistent not found 51 + [1]