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 list.t

[list] is non-recursive: it only shows the immediate children of the
given path, unlike [tree]. The test pins that contract with a
multi-level fixture, covers subpath listings, JSON output shape, and
the non-zero exit on an unknown branch. Output is piped through
[sort] where order is implementation-defined, so the assertion is on
membership rather than insertion order.

+41
+41
test/cram/list.t/run.t
··· 1 + irmin list - non-recursive directory listing 2 + 3 + [list PREFIX] shows the immediate children of the given path: files 4 + as bare names, directories with a trailing slash. Without PREFIX it 5 + lists the root. Entries come out in the order the backend returns 6 + them (insertion order for the Git backend). 7 + 8 + Set up a repository with a flat + one-level-deep layout: 9 + 10 + $ mkdir testrepo 11 + $ cd testrepo 12 + $ irmin init . 2>&1 > /dev/null 13 + $ irmin set README.md 'top' -m c1 2>&1 > /dev/null 14 + $ irmin set src/a.ml 'a' -m c2 2>&1 > /dev/null 15 + $ irmin set src/b.ml 'b' -m c3 2>&1 > /dev/null 16 + $ irmin set docs/intro.md 'i' -m c4 2>&1 > /dev/null 17 + 18 + Root listing. Only the immediate children appear; [src/a.ml] does 19 + *not* show up directly (that's [tree]'s job, not [list]'s): 20 + 21 + $ irmin list | sort 22 + README.md 23 + docs/ 24 + src/ 25 + 26 + Subpath lists one level deep. [src/] shows only [a.ml] and [b.ml]: 27 + 28 + $ irmin list src | sort 29 + a.ml 30 + b.ml 31 + 32 + JSON output is a single-line array of [{name, type}] objects: 33 + 34 + $ irmin list -o json src 35 + [{"name":"a.ml","type":"file"},{"name":"b.ml","type":"file"}] 36 + 37 + Listing an unknown branch reports an error and exits non-zero: 38 + 39 + $ irmin list -b does-not-exist 40 + ✗ Branch does-not-exist not found 41 + [1]