Skip to content

Commit 10e4e96

Browse files
authored
avoid the remaining Core.Box in the package using JuliaLang/julia#60478 (#189)
1 parent e40abe4 commit 10e4e96

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

src/Tar.jl

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -246,23 +246,19 @@ function extract(
246246
predicate === true_predicate || skeleton === nothing ||
247247
error("extract: predicate and skeleton cannot be used together")
248248
skeleton = something(skeleton, devnull)
249-
dir isa AbstractString && (dir = String(dir))
249+
dir_str = dir isa AbstractString ? String(dir) : dir
250250
check_extract_tarball(tarball)
251-
check_extract_dir(dir)
251+
check_extract_dir(dir_str)
252252
arg_read(tarball) do tar
253-
arg_mkdir(dir) do dir
254-
if copy_symlinks === nothing
255-
copy_symlinks = !can_symlink(dir)
256-
end
257-
let copy_symlinks=copy_symlinks
258-
arg_write(skeleton) do skeleton
259-
extract_tarball(
260-
predicate, tar, dir,
261-
skeleton = skeleton,
262-
copy_symlinks = copy_symlinks,
263-
set_permissions = set_permissions,
264-
)
265-
end
253+
arg_mkdir(dir_str) do dir
254+
copy_symlinks_local = copy_symlinks === nothing ? !can_symlink(dir) : copy_symlinks
255+
arg_write(skeleton) do skeleton
256+
extract_tarball(
257+
predicate, tar, dir,
258+
skeleton = skeleton,
259+
copy_symlinks = copy_symlinks_local,
260+
set_permissions = set_permissions,
261+
)
266262
end
267263
end
268264
end

src/extract.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ function hash_git_tree(node::GitTree, ::Type{HashType}) where HashType <: SHA.SH
289289
by((name, child)) = child isa GitTree ? "$name/" : name
290290
hash = git_object_hash("tree", HashType) do io
291291
for (name, child) in sort!(collect(node.children), by=by)
292-
mode, hash = hash_git_tree(child, HashType)
292+
mode, child_hash = hash_git_tree(child, HashType)
293293
print(io, mode, ' ', name, '\0')
294-
write(io, hex2bytes(hash))
294+
write(io, hex2bytes(child_hash))
295295
end
296296
end
297297
return ("40000", hash)

0 commit comments

Comments
 (0)