Skip to content
  • Jeff King's avatar
    t5303: use printf to generate delta bases · 18f60f2d
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    The exact byte count of the delta base file is important.
    The test-delta helper will feed it to patch_delta(), which
    will barf if it doesn't match the size byte given in the
    delta. Using "echo" may end up with unexpected line endings
    on some platforms (e.g,. "\r\n" instead of just "\n").
    
    This actually wouldn't cause the test to fail (since we
    already expect test-delta to complain about these bogus
    deltas), but would mean that we're not exercising the code
    we think we are.
    
    Let's use printf instead (which we already trust to give us
    byte-perfect output when we generate the deltas).
    
    While we're here, let's tighten the 5-byte result size used
    in the "truncated copy parameters" test. This just needs to
    have enough room to attempt to parse the bogus copy command,
    meaning 2 is sufficient. Using 5 was arbitrary and just
    copied from the base size; since those no longer match, it's
    simply confusing. Let's use a more meaningful number.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    18f60f2d