git putFile: support flake maximalists

Passing the commit message as an argument causes update failures on repositories with
lots of flake inputs. In some cases, the commit message is over 250,000 bytes.

Upstream PR: https://github.com/NixOS/nix/pull/10686

(cherry picked from commit 8b5e8f4fba5728f2b3e90fcd1ab15df77e3ea0e8)
Change-Id: I2c196a21cc9bedc24d57a828a0c5b9467e072f76
This commit is contained in:
Graham Christensen 2024-05-12 16:42:43 -04:00 committed by Maximilian Bosch
parent 992c63fc0b
commit 8220da8a53
Signed by: ma27
SSH key fingerprint: SHA256:d7dmwHmpai66L6KIXA+wxzVbkPq0nGLrcHK3ZNroqZY

View file

@ -402,7 +402,8 @@ struct GitInputScheme : InputScheme
logger->pause(); logger->pause();
Finally restoreLogger([]() { logger->resume(); }); Finally restoreLogger([]() { logger->resume(); });
runProgram("git", true, runProgram("git", true,
{ "-C", *root, "--git-dir", gitDir, "commit", std::string(path.rel()), "-m", *commitMsg }); { "-C", *root, "--git-dir", gitDir, "commit", std::string(path.rel()), "-F", "-" },
*commitMsg);
} }
} }
} }