1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-01 08:28:00 +02:00

refactor: RAII logger suspension

This commit is contained in:
Robert Hensing 2025-03-04 19:10:33 +01:00
parent 880489051a
commit 30694b5d8a
7 changed files with 46 additions and 35 deletions

View file

@ -351,8 +351,7 @@ struct GitInputScheme : InputScheme
if (commitMsg) {
// Pause the logger to allow for user input (such as a gpg passphrase) in `git commit`
logger->pause();
Finally restoreLogger([]() { logger->resume(); });
auto suspension = logger->suspend();
runProgram("git", true,
{ "-C", repoPath->string(), "--git-dir", repoInfo.gitDir, "commit", std::string(path.rel()), "-F", "-" },
*commitMsg);