Skip to content

Commit

Permalink
Disable git prompts for ssh remotes, pass through ssh-agent env varia…
Browse files Browse the repository at this point in the history
…bles. (#1821)
  • Loading branch information
fredrikekre authored May 22, 2022
1 parent 6fb684f commit ab9e056
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* ![Enhancement][badge-enhancement] The padding of the various container elements in the HTML style has been reduced, to improve the look of the generated HTML pages. ([#1814][github-1814], [#1818][github-1818])
* ![Bugfix][badge-bugfix] Build failures now only show fatal errors, rather than all errors. ([#1816][github-1816])
* ![Bugfix][badge-bugfix] Disable git terminal prompt when detecting remote HEAD branch for ssh remotes, and allow ssh-agent authentication (by appending rather than overriding ENV). ([#1821][github-1821])

## Version `v0.27.17`

Expand Down Expand Up @@ -1032,6 +1033,7 @@
[github-1814]: https://github.com/JuliaDocs/Documenter.jl/issues/1814
[github-1816]: https://github.com/JuliaDocs/Documenter.jl/pull/1816
[github-1818]: https://github.com/JuliaDocs/Documenter.jl/pull/1818
[github-1821]: https://github.com/JuliaDocs/Documenter.jl/pull/1821
<!-- end of issue link definitions -->

[julia-38079]: https://github.com/JuliaLang/julia/issues/38079
Expand Down
5 changes: 4 additions & 1 deletion src/Documenter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,12 @@ function deploydocs(;

# Try to figure out default branch (see #1443 and #1727)
if devbranch === nothing
env = copy(ENV)
env["GIT_TERMINAL_PROMPT"] = "0"
env["GIT_SSH_COMMAND"] = get(env, "GIT_SSH_COMMAND", "ssh -o \"BatchMode yes\"")
str = try
read(pipeline(ignorestatus(
setenv(`git remote show origin`, ["GIT_TERMINAL_PROMPT=0"]; dir=root)
setenv(`git remote show origin`, env; dir=root)
); stderr=devnull), String)
catch
""
Expand Down

0 comments on commit ab9e056

Please sign in to comment.