@@ -89,7 +89,7 @@ function checkout_tree_to_path(repo::LibGit2.GitRepo, tree::LibGit2.GitObject, p
8989 end
9090end
9191
92- function clone (io:: IO , url, source_path; header= nothing , credentials= nothing , kwargs... )
92+ function clone (io:: IO , url, source_path; header= nothing , credentials= nothing , isbare = false , kwargs... )
9393 url = String (url):: String
9494 source_path = String (source_path):: String
9595 @assert ! isdir (source_path) || isempty (readdir (source_path))
@@ -103,7 +103,9 @@ function clone(io::IO, url, source_path; header=nothing, credentials=nothing, kw
103103 end
104104 try
105105 if use_cli_git ()
106- cmd = ` git clone --quiet $url $source_path `
106+ args = [" --quiet" , url, source_path]
107+ isbare && pushfirst! (args, " --bare" )
108+ cmd = ` git clone $args `
107109 try
108110 run (pipeline (cmd; stdout = devnull ))
109111 catch err
@@ -122,7 +124,7 @@ function clone(io::IO, url, source_path; header=nothing, credentials=nothing, kw
122124 LibGit2. Callbacks ()
123125 end
124126 mkpath (source_path)
125- return LibGit2. clone (url, source_path; callbacks, credentials, kwargs... )
127+ return LibGit2. clone (url, source_path; callbacks, credentials, isbare, kwargs... )
126128 end
127129 catch err
128130 rm (source_path; force= true , recursive= true )
@@ -151,7 +153,6 @@ function fetch(io::IO, repo::LibGit2.GitRepo, remoteurl=nothing; header=nothing,
151153 remoteurl = normalize_url (remoteurl)
152154 printpkgstyle (io, :Updating , header === nothing ? " git-repo `$remoteurl `" : header)
153155 bar = MiniProgressBar (header = " Fetching:" , color = Base. info_color ())
154- fancyprint = can_fancyprint (io)
155156 callbacks = if fancyprint
156157 LibGit2. Callbacks (
157158 :transfer_progress => (
0 commit comments