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

Function cmd_version

help.c:833–855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

831}
832
833int cmd_version(int argc, const char **argv, const char *prefix, struct repository *repository UNUSED)
834{
835 struct strbuf buf = STRBUF_INIT;
836 int build_options = 0;
837 const char * const usage[] = {
838 N_("git version [--build-options]"),
839 NULL
840 };
841 struct option options[] = {
842 OPT_BOOL(0, "build-options", &build_options,
843 "also print build options"),
844 OPT_END()
845 };
846
847 argc = parse_options(argc, argv, prefix, options, usage, 0);
848
849 get_version_info(&buf, build_options);
850 printf("%s", buf.buf);
851
852 strbuf_release(&buf);
853
854 return 0;
855}
856
857struct similar_ref_cb {
858 const char *base_ref;

Callers

nothing calls this directly

Calls 3

parse_optionsFunction · 0.85
get_version_infoFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected