(repo: Path, *, base: str, head: str)
| 175 | |
| 176 | |
| 177 | def compare_refs(repo: Path, *, base: str, head: str) -> dict[str, Any]: |
| 178 | _require_ref(repo, base) |
| 179 | _require_ref(repo, head) |
| 180 | merge_base = _git_stdout(repo, ["merge-base", base, head]).strip() or None |
| 181 | ahead, behind = _ahead_behind(repo, base, head) |
| 182 | commits = _compare_commits(repo, base=base, head=head) |
| 183 | files = _compare_files(repo, base=base, head=head) |
| 184 | return { |
| 185 | "ok": True, |
| 186 | "base": base, |
| 187 | "head": head, |
| 188 | "merge_base": merge_base, |
| 189 | "ahead": ahead, |
| 190 | "behind": behind, |
| 191 | "commit_count": len(commits), |
| 192 | "file_count": len(files), |
| 193 | "commits": commits, |
| 194 | "files": files, |
| 195 | } |
| 196 | |
| 197 | |
| 198 | def diff_file_between_refs(repo: Path, *, base: str, head: str, path: str) -> dict[str, Any]: |
no test coverage detected