Skip to content

Commit fdc0f33

Browse files
committed
Merge branch 'dt/t0410-missing-tree-test' into seen
The missing-tree test in 't0410' has been cleaned up to avoid dropped exit codes and hardcoded assumptions about the length of object names. * dt/t0410-missing-tree-test: t0410: keep git's exit code in test_grep calls t0410: use rev-parse to get the subtree OID
2 parents 5c32104 + 98d6ff3 commit fdc0f33

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎t/t0410-partial-clone.sh‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,17 +405,21 @@ test_expect_success 'rev-list stops traversal at missing and promised tree' '
405405
TREE=$(git -C repo rev-parse foo^{tree}) &&
406406
407407
# a tree referenced by HEAD^{tree} (tree referenced from tree)
408-
TREE2=$(git -C repo ls-tree HEAD^{tree} | grep " tree " | head -1 | cut -b13-52) &&
408+
TREE2=$(git -C repo rev-parse HEAD:a_dir) &&
409409
410410
promise_and_delete "$TREE" &&
411411
promise_and_delete "$TREE2" &&
412412
413413
git -C repo config core.repositoryformatversion 1 &&
414414
git -C repo config extensions.partialclone "arbitrary string" &&
415415
git -C repo rev-list --exclude-promisor-objects --objects HEAD >out &&
416-
test_grep $(git -C repo rev-parse foo) out &&
416+
417+
FOO=$(git -C repo rev-parse foo) &&
418+
HEAD_OID=$(git -C repo rev-parse HEAD) &&
419+
420+
test_grep "$FOO" out &&
417421
test_grep ! $TREE out &&
418-
test_grep $(git -C repo rev-parse HEAD) out &&
422+
test_grep "$HEAD_OID" out &&
419423
test_grep ! $TREE2 out
420424
'
421425

0 commit comments

Comments
 (0)