[Outreachy PATCH v2 0/2] t0410: fix exit code and hash assumptions in the missing-tree test
- From
- Dorine Tipo <dorine.a.tipo@gmail.com>
- Date
- Oct 20, 2026, 16:01 UTC
- Message-ID
- <20261020160127.29096-1-dorine.a.tipo@gmail.com>
- In-Reply-To
- <20261014134504.1152225-1-dorine.a.tipo@gmail.com>
This series cleans up the 'rev-list stops traversal at missing and promised tree' test in t0410.
Changes since v1: - 1/2: expanded the log message to note that the original pipeline silently assumed the first tree in the ls-tree output was the one we wanted, and that naming a_dir explicitly is an improvement. Thanks, Junio. - 2/2: unchanged.
I ran the full test suite with both SHA-1 and SHA-256, and it passes.
Dorine Tipo (2): t0410: use rev-parse to get the subtree OID t0410: keep git's exit code in test_grep calls
t/t0410-partial-clone.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
Range-diff against v1:
1: b8f514e0a2 ! 1: dcf6c7da4c t0410: use rev-parse to get the subtree OID
@@ Commit message
The pipeline goes against t/README which says not to pipe the output
of a git command, since only the last command's exit code is kept.
- 'cut -b13-52' also assumes a 40-character SHA-1 name, so under SHA-256
- TREE2 holds an abbreviated OID.
+ It also silently assumes that the first tree in the ls-tree output is
+ the one we want, without checking which path it is stored at.
+ And 'cut -b13-52' also assumes a 40-character SHA-1 name, so under
+ SHA-256 TREE2 holds an abbreviated OID.
- Use 'git rev-parse HEAD:a_dir' instead. It returns the full OID in a
- single command, the same way TREE is computed with
- 'git rev-parse foo^{tree}' just above.
+ Use 'git rev-parse HEAD:a_dir' instead. It names the directory we are
+ interested in explicitly and returns the full OID in a single command,
+ the same way TREE is computed with 'git rev-parse foo^{tree}' just
+ above.
+ Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Dorine Tipo <dorine.a.tipo@gmail.com>
## t/t0410-partial-clone.sh ##
2: 5823e65a88 = 2: f810625e77 t0410: keep git's exit code in test_grep calls-- 2.34.1