MCPcopy Index your code
hub / github.com/git/git / setup_path

Function setup_path

exec-cmd.c:333–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333void setup_path(void)
334{
335 const char *exec_path = git_exec_path();
336 const char *old_path = getenv("PATH");
337 struct strbuf new_path = STRBUF_INIT;
338
339 git_set_exec_path(exec_path);
340 add_path(&new_path, exec_path);
341
342 if (old_path)
343 strbuf_addstr(&new_path, old_path);
344 else
345 strbuf_addstr(&new_path, _PATH_DEFPATH);
346
347 setenv("PATH", new_path.buf, 1);
348
349 strbuf_release(&new_path);
350}
351
352const char **prepare_git_cmd(struct strvec *out, const char **argv)
353{

Callers 5

do_generic_cmdFunction · 0.85
cmd_mainFunction · 0.85
cmd_mainFunction · 0.85
cmd_upload_packFunction · 0.85
cmd_receive_packFunction · 0.85

Calls 5

git_exec_pathFunction · 0.85
git_set_exec_pathFunction · 0.85
strbuf_addstrFunction · 0.85
strbuf_releaseFunction · 0.85
add_pathFunction · 0.70

Tested by

no test coverage detected