From 696b13a4363d3fc4251482d3c765b95ecabcab05 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Tue, 12 Apr 2022 13:22:07 +0200 Subject: [PATCH] Disable git terminal prompt when detecting remote HEAD branch. --- CHANGELOG.md | 3 +++ src/Literate.jl | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d10864..c0c5d9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ 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 +- Disable git terminal prompt when detecting remote HEAD branch. ([#194][github-194]) ## [2.13.0] - 2022-02-18 ### Changed @@ -196,6 +198,7 @@ https://discourse.julialang.org/t/ann-literate-jl/10651 for release announcement [github-187]: https://github.com/fredrikekre/Literate.jl/pull/187 [github-188]: https://github.com/fredrikekre/Literate.jl/pull/188 [github-190]: https://github.com/fredrikekre/Literate.jl/pull/190 +[github-194]: https://github.com/fredrikekre/Literate.jl/pull/194 [Unreleased]: https://github.com/fredrikekre/Literate.jl/compare/v2.13.0...HEAD [2.13.0]: https://github.com/fredrikekre/Literate.jl/compare/v2.12.1...v2.13.0 diff --git a/src/Literate.jl b/src/Literate.jl index 3301ae9..a60006c 100644 --- a/src/Literate.jl +++ b/src/Literate.jl @@ -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`; dir=dirname(inputfile)) + setenv(`$(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])