"Derrick Stolee via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: [snip] > diff --git a/t/t6601-path-walk.sh b/t/t6601-path-walk.sh > new file mode 100755 > index 00000000000..1f277b88291 > --- /dev/null > +++ b/t/t6601-path-walk.sh > @@ -0,0 +1,118 @@ > +#!/bin/sh > + > +test_description='direct path-walk API tests' > + > +. ./test-lib.sh > + > +test_expect_success 'setup test repository' ' > + git checkout -b base && > + > + mkdir left && > + mkdir right && > + echo a >a && > + echo b >left/b && > + echo c >right/c && > + git add . && > + git commit -m "first" && > + > + echo d >right/d && > + git add right && > + git commit -m "second" && > + > + echo bb >left/b && > + git commit -a -m "third" && > + > + git checkout -b topic HEAD~1 && > + echo cc >right/c && > + git commit -a -m "topic" > +' > + Nit: Since the root level tree is already special cased out, we only check one level of path here, would be nice to add another level of tree to this. > +test_expect_success 'all' ' > + test-tool path-walk -- --all >out && > + > + cat >expect <<-EOF && > + TREE::$(git rev-parse topic^{tree}) > + TREE::$(git rev-parse base^{tree}) > + TREE::$(git rev-parse base~1^{tree}) > + TREE::$(git rev-parse base~2^{tree}) > + TREE:left/:$(git rev-parse base:left) > + TREE:left/:$(git rev-parse base~2:left) > + TREE:right/:$(git rev-parse topic:right) > + TREE:right/:$(git rev-parse base~1:right) > + TREE:right/:$(git rev-parse base~2:right) > + trees:9 > + BLOB:a:$(git rev-parse base~2:a) > + BLOB:left/b:$(git rev-parse base~2:left/b) > + BLOB:left/b:$(git rev-parse base:left/b) > + BLOB:right/c:$(git rev-parse base~2:right/c) > + BLOB:right/c:$(git rev-parse topic:right/c) > + BLOB:right/d:$(git rev-parse base~1:right/d) > + blobs:6 > + EOF > + > + test_cmp_sorted expect out > +' Isn't the order deterministic? Why do we need to sort it?
Attachment:
signature.asc
Description: PGP signature