git-credential-manager: inherit argv0

`git-credential-manager configure` sets up the user's Git configuration
to use the tool as a credential helper.  In Nix, the tool is wrapped,
but the configuration command uses the unwrapped command that doesn't
have the PATH set up and therefore fails.  Resolve this by including
`--inherit-argv0` in the wrapper, so the configuration is set up with
the wrapped version of the executable.

This will also mean that the specific git-credential-manager version
isn't hard-coded into the user's Git configuration files, at least
unless the user is calling git-credential-manager that way, and instead
the configuration will list whatever was found in the user's PATH, which
means user configuration will continue to work after
git-credential-manager is updated.

Fixes #298080.
This commit is contained in:
Adam Dinwoodie 2024-10-09 14:53:34 +01:00
parent e4a2b7892d
commit 037dffe546

View File

@ -41,6 +41,7 @@ buildDotnetModule rec {
++ lib.optional withLibsecretSupport libsecret;
makeWrapperArgs = [
"--prefix PATH : ${lib.makeBinPath ([ git ] ++ lib.optionals withGpgSupport [ gnupg pass ])}"
"--inherit-argv0"
];
passthru = {