Skip to main content

git_command

Function git_command 

Source
pub fn git_command(
    real_git: &Path,
    arguments: &[OsString],
    overlay: &[(OsString, OsString)],
) -> Command
Expand description

What: Build the child command: program, unchanged arguments, added variables. &[OsString] borrows the argument list; &[(OsString, OsString)] borrows name/value pairs. Why: One builder guarantees every real-Git start, forwarded or queried, uses an argument array (no shell string) and inherits the caller’s environment plus only the overlay.

In TS you’d write (pseudocode):

function gitCommand(realGit: string, args: string[], overlay: [string, string][]): Command;