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

Function is_range_diff_range

range-diff.c:616–642  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

614}
615
616int is_range_diff_range(const char *arg)
617{
618 char *copy = xstrdup(arg); /* setup_revisions() modifies it */
619 const char *argv[] = { "", copy, "--", NULL };
620 int i, positive = 0, negative = 0;
621 struct rev_info revs;
622
623 repo_init_revisions(the_repository, &revs, NULL);
624 if (setup_revisions(3, argv, &revs, NULL) == 1) {
625 for (i = 0; i < revs.pending.nr; i++)
626 if (revs.pending.objects[i].item->flags & UNINTERESTING)
627 negative++;
628 else
629 positive++;
630 for (i = 0; i < revs.pending.nr; i++) {
631 struct object *obj = revs.pending.objects[i].item;
632
633 if (obj->type == OBJ_COMMIT)
634 clear_commit_marks((struct commit *)obj,
635 ALL_REV_FLAGS);
636 }
637 }
638
639 free(copy);
640 release_revisions(&revs);
641 return negative > 0 && positive > 0;
642}

Callers 2

infer_range_diff_rangesFunction · 0.85
cmd_range_diffFunction · 0.85

Calls 5

xstrdupFunction · 0.85
repo_init_revisionsFunction · 0.85
setup_revisionsFunction · 0.85
clear_commit_marksFunction · 0.85
release_revisionsFunction · 0.85

Tested by

no test coverage detected