MCPcopy Create free account
hub / github.com/git/git / bisect_successful

Function bisect_successful

builtin/bisect.c:655–676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

653}
654
655static int bisect_successful(struct bisect_terms *terms)
656{
657 struct object_id oid;
658 struct commit *commit;
659 struct pretty_print_context pp = {0};
660 struct strbuf commit_name = STRBUF_INIT;
661 char *bad_ref = xstrfmt("refs/bisect/%s",terms->term_bad);
662 int res;
663
664 refs_read_ref(get_main_ref_store(the_repository), bad_ref, &oid);
665 commit = lookup_commit_reference_by_name(bad_ref);
666 repo_format_commit_message(the_repository, commit, "%s", &commit_name,
667 &pp);
668
669 res = append_to_file(git_path_bisect_log(), "# first '%s' commit: [%s] %s\n",
670 terms->term_bad, oid_to_hex(&commit->object.oid),
671 commit_name.buf);
672
673 strbuf_release(&commit_name);
674 free(bad_ref);
675 return res;
676}
677
678static enum bisect_error bisect_next(struct bisect_terms *terms, const char *prefix)
679{

Callers 1

bisect_nextFunction · 0.85

Calls 8

xstrfmtFunction · 0.85
refs_read_refFunction · 0.85
get_main_ref_storeFunction · 0.85
append_to_fileFunction · 0.85
oid_to_hexFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected