Skip to content

Commit 1c35395

Browse files
authored
Do a bare clone when getting tree SHA (#340)
Doing a bare git clone: * Makes all the remote branches local * Gives us all the tags Its also slightly faster than just clone. This will fix #339 and also correctly fixes what #335 tried to fix
1 parent 50b8dbf commit 1c35395

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/webui/gitutils.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ function gettreesha(
165165
return try
166166
mktempdir() do dir
167167
dest = joinpath(dir, r.name)
168-
run(`git clone $url $dest`)
168+
run(`git clone --bare $url $dest`)
169169

170170
if isdir(joinpath(dest, subdir))
171-
readchomp(`git -C $dest rev-parse origin/$ref:$subdir`), ""
171+
readchomp(`git -C $dest rev-parse $ref:$subdir`), ""
172172
else
173173
nothing, "The sub-directory $subdir does not exist in this repository"
174174
end

0 commit comments

Comments
 (0)