diff options
author | eldritch horrors <pennae@lix.systems> | 2024-03-04 06:01:09 +0100 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-03-04 06:01:09 +0100 |
commit | cba87025f8c0e831a9195ad43d038ce72a69225f (patch) | |
tree | b5c4011dff8c6caa8166d6be8b18c3864518d2c1 /src | |
parent | 9981c714f632fe755f9ebc5aff3b1b7bf6c142d2 (diff) |
Merge pull request #9445 from NixOS/allow-input-in-git-commit
Allow user input in `git commit`
(cherry picked from commit 43fb39ca29a0b054a4c18623520c496d27c57192)
Change-Id: I13bd4c007234ee2133289c68ef8ab2eae4def78a
Diffstat (limited to 'src')
-rw-r--r-- | src/libfetchers/git.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index f8d89ab2f..321950e63 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -7,6 +7,8 @@ #include "pathlocks.hh" #include "util.hh" #include "git.hh" +#include "logging.hh" +#include "finally.hh" #include "fetch-settings.hh" @@ -378,6 +380,9 @@ struct GitInputScheme : InputScheme runProgram("git", true, { "-C", *sourcePath, "--git-dir", gitDir, "add", "--intent-to-add", "--", std::string(file) }); + // Pause the logger to allow for user input (such as a gpg passphrase) in `git commit` + logger->pause(); + Finally restoreLogger([]() { logger->resume(); }); if (commitMsg) runProgram("git", true, { "-C", *sourcePath, "--git-dir", gitDir, "commit", std::string(file), "-m", *commitMsg }); |