Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion stdlib/LibGit2/src/gitcredential.jl
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ function credential_helpers(cfg::GitConfig, cred::GitCredential)
helpers = GitCredentialHelper[]

# https://git-scm.com/docs/gitcredentials#gitcredentials-helper
for entry in GitConfigIter(cfg, r"credential.*\.helper")
for entry in GitConfigIter(cfg, r"credential.*\.helper$")
section, url, name, value = split_cfg_entry(entry)
@assert name == "helper"

Expand Down
14 changes: 6 additions & 8 deletions stdlib/LibGit2/test/libgit2-tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1994,7 +1994,7 @@ mktempdir() do dir
@test parse(GitCredentialHelper, "store") == GitCredentialHelper(`git credential-store`)
end

@testset "empty helper" begin
@testset "credential_helpers" begin
config_path = joinpath(dir, config_file)

# Note: LibGit2.set! doesn't allow us to set duplicates or ordering
Expand All @@ -2007,16 +2007,14 @@ mktempdir() do dir
[credential]
helper = !echo second
""")
# Git for Windows uses this config (see issue #45693)
write(fp,"""
[credential "helperselector"]
selected = manager-core
""")
end

LibGit2.with(LibGit2.GitConfig(config_path, LibGit2.Consts.CONFIG_LEVEL_APP)) do cfg
iter = LibGit2.GitConfigIter(cfg, r"credential.*\.helper")
@test LibGit2.split_cfg_entry.(iter) == [
("credential", "", "helper", "!echo first"),
("credential", "https://mygithost", "helper", ""),
("credential", "", "helper", "!echo second"),
]

expected = [
GitCredentialHelper(`echo first`),
GitCredentialHelper(`echo second`),
Expand Down