mirror of
https://github.com/git/git.git
synced 2024-10-28 12:59:41 +01:00
archive-tar: turn length miscalculation warning into BUG
Now that we're confident our pax extended header calculation is correct, turn the criticality of the assertion up to the maximum, from warning right up to BUG. Simplify the test, as the stderr comparison step would not be reached in case the BUG message is triggered. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
17e9ef00d2
commit
71d41ff651
2 changed files with 4 additions and 5 deletions
|
@ -158,9 +158,9 @@ static void strbuf_append_ext_header(struct strbuf *sb, const char *keyword,
|
||||||
strbuf_addch(sb, '\n');
|
strbuf_addch(sb, '\n');
|
||||||
|
|
||||||
if (len != sb->len - orig_len)
|
if (len != sb->len - orig_len)
|
||||||
warning("pax extended header length miscalculated as %"PRIuMAX
|
BUG("pax extended header length miscalculated as %"PRIuMAX
|
||||||
", should be %"PRIuMAX,
|
", should be %"PRIuMAX,
|
||||||
(uintmax_t)len, (uintmax_t)(sb->len - orig_len));
|
(uintmax_t)len, (uintmax_t)(sb->len - orig_len));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -220,8 +220,7 @@ build_tree() {
|
||||||
test_expect_success 'tar archive with long paths' '
|
test_expect_success 'tar archive with long paths' '
|
||||||
blob=$(echo foo | git hash-object -w --stdin) &&
|
blob=$(echo foo | git hash-object -w --stdin) &&
|
||||||
tree=$(build_tree $blob | git mktree) &&
|
tree=$(build_tree $blob | git mktree) &&
|
||||||
git archive -o long_paths.tar $tree 2>stderr &&
|
git archive -o long_paths.tar $tree
|
||||||
test_must_be_empty stderr
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in a new issue