Skip to content

Commit

Permalink
Use addenv instead of setenv for git command when figuring out HEAD b…
Browse files Browse the repository at this point in the history
…ranch, fixes #197.
  • Loading branch information
fredrikekre committed May 21, 2022
1 parent b8cbc67 commit a7bdb8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Update remote HEAD branch detection to use `addenv` instead of `setenv` such that e.g.
ssh-agent variables are still available to the git command. ([#197][github-197])

## [2.13.2] - 2022-04-22
### Fixed
Expand Down Expand Up @@ -209,6 +212,7 @@ https://discourse.julialang.org/t/ann-literate-jl/10651 for release announcement
[github-190]: https://github.com/fredrikekre/Literate.jl/pull/190
[github-194]: https://github.com/fredrikekre/Literate.jl/pull/194
[github-195]: https://github.com/fredrikekre/Literate.jl/pull/195
[github-197]: https://github.com/fredrikekre/Literate.jl/issues/197

[Unreleased]: https://github.com/fredrikekre/Literate.jl/compare/v2.13.2...HEAD
[2.13.2]: https://github.com/fredrikekre/Literate.jl/compare/v2.13.1...v2.13.2
Expand Down
2 changes: 1 addition & 1 deletion src/Literate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ function create_configuration(inputfile; user_config, user_kwargs, type=nothing)
if (git = Sys.which("git"); git !== nothing)
try
str = read(pipeline(ignorestatus(
setenv(`$(git) remote show origin`, ["GIT_TERMINAL_PROMPT=0"]; dir=dirname(inputfile))
addenv(`$(git) remote show origin`, ["GIT_TERMINAL_PROMPT=0"]; dir=dirname(inputfile))
), stderr=devnull), String)
if (m = match(r"^\s*HEAD branch:\s*(.*)$"m, str); m !== nothing)
fallback_edit_commit = String(m[1])
Expand Down

0 comments on commit a7bdb8c

Please sign in to comment.