Skip to content

t0410: fix exit code and hash assumptions in the missing-tree test

Dorine Tipo git 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesIn review
  2. v12 patches 2 repliesSuperseded

Changes in v2 from the cover letter

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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2t0410: use rev-parse to get the subtree OIDt/t0410-partial-clone.sh+1 -11 reply
2/2t0410: keep git's exit code in test_grep callst/t0410-partial-clone.sh+6 -21 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchJunio C HamanoLaveesh Bansal
1/2Helped-by R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [Outreachy PATCH v2 0/2] t0410: fix exit code and hash assumptions in the missing-tree test

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 <[email protected]>

## t/t0410-partial-clone.sh ##
2: 5823e65a88 = 2: f810625e77 t0410: keep git's exit code in test_grep calls

Signature · 1 line
2.34.1