]> git.ipfire.org Git - thirdparty/git.git/commitdiff
archive-tar: turn length miscalculation warning into BUG
authorRené Scharfe <l.s.r@web.de>
Sat, 17 Aug 2019 16:24:23 +0000 (18:24 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Aug 2019 17:49:00 +0000 (10:49 -0700)
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>
archive-tar.c
t/t5004-archive-corner-cases.sh

index 29ca21649ee539e358ee584e91f35910eb40619a..e7153c69e7a87322afa8a8614bf6c5796da5a701 100644 (file)
@@ -158,9 +158,9 @@ static void strbuf_append_ext_header(struct strbuf *sb, const char *keyword,
        strbuf_addch(sb, '\n');
 
        if (len != sb->len - orig_len)
-               warning("pax extended header length miscalculated as %"PRIuMAX
-                       ", should be %"PRIuMAX,
-                       (uintmax_t)len, (uintmax_t)(sb->len - orig_len));
+               BUG("pax extended header length miscalculated as %"PRIuMAX
+                   ", should be %"PRIuMAX,
+                   (uintmax_t)len, (uintmax_t)(sb->len - orig_len));
 }
 
 /*
index 4966a74b4d083f5dfedaaf3c8873d1c06f0a7fac..3e7b23cb32c581b88473b596036517a38c51c9fd 100755 (executable)
@@ -220,8 +220,7 @@ build_tree() {
 test_expect_success 'tar archive with long paths' '
        blob=$(echo foo | git hash-object -w --stdin) &&
        tree=$(build_tree $blob | git mktree) &&
-       git archive -o long_paths.tar $tree 2>stderr &&
-       test_must_be_empty stderr
+       git archive -o long_paths.tar $tree
 '
 
 test_done