JuliaIO / Tar.jl

TAR files: create, list, extract them in pure Julia
MIT License
79 stars 19 forks source link

fix bugs handling unusual tarballs with directory after contents #105

Closed StefanKarpinski closed 3 years ago

StefanKarpinski commented 3 years ago

This fixes three related bugs when processing tarballs where a directory entry appears after some contents of that directory. This is unusual since neither command-line tar nor Tar.create will produce tarballs like this, and I only dicovered the bug when I accidentally modified Tar.create to emit directory entries after emiting everything inside of the directory. Each of extract, tree_hash and rewrite did this wrong in slightly different ways previously. Now they all (hopefully) do the right thing, and we test that they each handle a manually generated tarball with this kind of unusual ordering.

codecov[bot] commented 3 years ago

Codecov Report

Merging #105 (37c8e83) into master (008a3f2) will increase coverage by 0.02%. The diff coverage is 100.00%.

:exclamation: Current head 37c8e83 differs from pull request most recent head d0e2838. Consider uploading reports for the commit d0e2838 to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master     #105      +/-   ##
==========================================
+ Coverage   96.26%   96.29%   +0.02%     
==========================================
  Files           4        4              
  Lines         643      648       +5     
==========================================
+ Hits          619      624       +5     
  Misses         24       24              
Impacted Files Coverage Δ
src/create.jl 97.07% <100.00%> (+0.01%) :arrow_up:
src/extract.jl 96.37% <100.00%> (+0.03%) :arrow_up:
src/Tar.jl 96.10% <0.00%> (+0.05%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 008a3f2...d0e2838. Read the comment docs.