-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove LibGit2 deprecations. (#28460)
- Loading branch information
1 parent
5d43217
commit f7d9a8b
Showing
2 changed files
with
3 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1 @@ | ||
# This file is a part of Julia. License is MIT: https://julialang.org/license | ||
|
||
# BEGIN 0.7 deprecations | ||
|
||
# PR #22062 | ||
function set_remote_url(repo::LibGit2.GitRepo, url::AbstractString; remote::AbstractString="origin") | ||
Base.depwarn(string( | ||
"`LibGit2.set_remote_url(repo, url; remote=remote)` is deprecated, use ", | ||
"`LibGit2.set_remote_url(repo, remote, url)` instead."), :set_remote_url) | ||
set_remote_url(repo, remote, url) | ||
end | ||
|
||
function set_remote_url(path::AbstractString, url::AbstractString; remote::AbstractString="origin") | ||
Base.depwarn(string( | ||
"`LibGit2.set_remote_url(path, url; remote=remote)` is deprecated, use ", | ||
"`LibGit2.set_remote_url(path, remote, url)` instead."), :set_remote_url) | ||
set_remote_url(path, remote, url) | ||
end | ||
|
||
function prompt(msg::AbstractString; default::AbstractString="", password::Bool=false) | ||
Base.depwarn(string( | ||
"`LibGit2.prompt(msg::AbstractString; default::AbstractString=\"\", password::Bool=false)` is deprecated, use ", | ||
"`result = Base.prompt(msg, default=default, password=password); result === nothing ? \"\" : result` instead."), :prompt) | ||
something(Base.prompt(msg, default=default, password=password), "") | ||
end | ||
|
||
# PR #26437 | ||
# when this deprecation is deleted, remove all calls to it, and remove the keyword of: | ||
# `payload` from "src/LibGit2.jl" | ||
function deprecate_payload_keyword(f, sig, payload) | ||
if payload !== nothing | ||
Base.depwarn(string( | ||
"`LibGit2.$f($sig; payload=cred)` is deprecated, use ", | ||
"`LibGit2.$f($sig; credentials=cred)` instead."), f) | ||
end | ||
end | ||
|
||
@deprecate get_creds!(cache::CachedCredentials, credid, default) get!(cache, credid, default) | ||
|
||
@eval Base @deprecate merge!(repo::$(GitRepo), args...; kwargs...) $(LibGit2.merge!)(repo, args...; kwargs...) | ||
@eval Base @deprecate push!(w::$(GitRevWalker), arg) $(LibGit2.push!)(w, arg) | ||
@eval Base @deprecate count(diff::$(GitDiff)) $(LibGit2.count)(diff) | ||
@eval Base @deprecate count(idx::$(GitIndex)) $(LibGit2.count)(idx) | ||
@eval Base @deprecate count(rb::$(GitRebase)) $(LibGit2.count)(rb) | ||
@eval Base @deprecate count(tree::$(GitTree)) $(LibGit2.count)(tree) | ||
@eval Base @deprecate count(f::Function, walker::$(GitRevWalker); kwargs...) $(LibGit2.count)(f, walker; kwargs...) | ||
@eval Base @deprecate map(f::Function, walker::$(GitRevWalker); kwargs...) $(LibGit2.map)(f, walker; kwargs...) | ||
|
||
# PR #24594 | ||
@deprecate AbstractCredentials AbstractCredential false | ||
@deprecate UserPasswordCredentials UserPasswordCredential false | ||
@deprecate SSHCredentials SSHCredential false | ||
|
||
@deprecate hex(id::LibGit2.GitHash) string(id) | ||
@deprecate hex(id::LibGit2.GitShortHash) string(id) |