libfetchers: write git commit message to tempfile
we want to remove runProgram's ability to provide stdin to a process because the concurrency issues of handling both stdin and stdout are much more pronounced once runProgram returns not is collected output but a source. this is possible in the current c++ framework, however it isn't necessary in almost all cases (as demonstrated by only this single user existing) and in much better handled with a proper async concurrency model that lets the caller handle both at the same time. Change-Id: I29da1e1ad898d45e2e33a7320b246d5003e7712b
This commit is contained in:
parent
2fe9157808
commit
2bbdaf0b19
1 changed files with 5 additions and 2 deletions
|
@ -396,12 +396,15 @@ struct GitInputScheme : InputScheme
|
|||
|
||||
|
||||
if (commitMsg) {
|
||||
auto [_fd, msgPath] = createTempFile("nix-msg");
|
||||
AutoDelete const _delete{msgPath};
|
||||
writeFile(msgPath, *commitMsg);
|
||||
|
||||
// Pause the logger to allow for user input (such as a gpg passphrase) in `git commit`
|
||||
logger->pause();
|
||||
Finally restoreLogger([]() { logger->resume(); });
|
||||
runProgram("git", true,
|
||||
{ "-C", *root, "--git-dir", gitDir, "commit", std::string(path.rel()), "-F", "-" },
|
||||
*commitMsg);
|
||||
{ "-C", *root, "--git-dir", gitDir, "commit", std::string(path.rel()), "-F", msgPath });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue