Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions src/Tar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -246,23 +246,19 @@ function extract(
predicate === true_predicate || skeleton === nothing ||
error("extract: predicate and skeleton cannot be used together")
skeleton = something(skeleton, devnull)
dir isa AbstractString && (dir = String(dir))
dir_str = dir isa AbstractString ? String(dir) : dir
check_extract_tarball(tarball)
check_extract_dir(dir)
check_extract_dir(dir_str)
arg_read(tarball) do tar
arg_mkdir(dir) do dir
if copy_symlinks === nothing
copy_symlinks = !can_symlink(dir)
end
let copy_symlinks=copy_symlinks
arg_write(skeleton) do skeleton
extract_tarball(
predicate, tar, dir,
skeleton = skeleton,
copy_symlinks = copy_symlinks,
set_permissions = set_permissions,
)
end
arg_mkdir(dir_str) do dir
copy_symlinks_local = copy_symlinks === nothing ? !can_symlink(dir) : copy_symlinks
arg_write(skeleton) do skeleton
extract_tarball(
predicate, tar, dir,
skeleton = skeleton,
copy_symlinks = copy_symlinks_local,
set_permissions = set_permissions,
)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions src/extract.jl
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ function hash_git_tree(node::GitTree, ::Type{HashType}) where HashType <: SHA.SH
by((name, child)) = child isa GitTree ? "$name/" : name
hash = git_object_hash("tree", HashType) do io
for (name, child) in sort!(collect(node.children), by=by)
mode, hash = hash_git_tree(child, HashType)
mode, child_hash = hash_git_tree(child, HashType)
print(io, mode, ' ', name, '\0')
write(io, hex2bytes(hash))
write(io, hex2bytes(child_hash))
end
end
return ("40000", hash)
Expand Down
Loading