Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small fixes in GitTools module #3849

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 2 additions & 6 deletions src/GitTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function clone(io::IO, url, source_path; header=nothing, credentials=nothing, kw
@assert !isdir(source_path) || isempty(readdir(source_path))
url = normalize_url(url)
printpkgstyle(io, :Cloning, header === nothing ? "git-repo `$url`" : header)
bar = MiniProgressBar(header = "Fetching:", color = Base.info_color())
bar = MiniProgressBar(header = "Cloning:", color = Base.info_color())
fancyprint = can_fancyprint(io)
callbacks = if fancyprint
LibGit2.Callbacks(
Expand Down Expand Up @@ -137,7 +137,7 @@ function clone(io::IO, url, source_path; header=nothing, credentials=nothing, kw
end
end

function fetch(io::IO, repo::LibGit2.GitRepo, remoteurl=nothing; header=nothing, credentials=nothing, refspecs=[""], kwargs...)
function fetch(io::IO, repo::LibGit2.GitRepo, remoteurl=nothing; header=nothing, refspecs=[""], kwargs...)
if remoteurl === nothing
remoteurl = LibGit2.with(LibGit2.get(LibGit2.GitRemote, repo, "origin")) do remote
LibGit2.url(remote)
Expand All @@ -159,9 +159,6 @@ function fetch(io::IO, repo::LibGit2.GitRepo, remoteurl=nothing; header=nothing,
LibGit2.Callbacks()
end
fancyprint && start_progress(io, bar)
if credentials === nothing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be used instead of being removed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was unsure which direction we want to go with this.
I went with removing it as that seemed more conservative to me, but I am open to using it.
I will add a commit to use it.

credentials = LibGit2.CachedCredentials()
end
try
if use_cli_git()
let remoteurl=remoteurl
Expand All @@ -185,7 +182,6 @@ function fetch(io::IO, repo::LibGit2.GitRepo, remoteurl=nothing; header=nothing,
Pkg.Types.pkgerror("failed to fetch from $(remoteurl), error: $err")
end
finally
Base.shred!(credentials)
fancyprint && end_progress(io, bar)
end
end
Expand Down
Loading