Show recent commit history in the explorer (#2312)

* feat(app): show recent commit history in explorer

* fix(app): keep recent commit history accurate

* fix(app): include merged commits in recent history

* perf(app): bound recent commit classification

* fix(app): refresh recent commits on Git updates
This commit is contained in:
Mohamed Boudra
2026-07-21 22:12:33 +02:00
committed by GitHub
parent 2ed1f4f353
commit 309672c8e5
15 changed files with 180 additions and 97 deletions
@@ -88,4 +88,22 @@ describe("getCommitFileDiff", () => {
expect(file).toBeNull();
});
it("returns a merge commit diff against its first parent", async () => {
const repoDir = initRepo();
commitFile(repoDir, "README.md", "base\n", "initial");
git(["checkout", "-b", "feature"], repoDir);
commitFile(repoDir, "feature.txt", "feature\n", "add feature");
git(["checkout", "main"], repoDir);
commitFile(repoDir, "main.txt", "main\n", "advance main");
git(["merge", "--no-ff", "feature", "-m", "merge feature"], repoDir);
const sha = headSha(repoDir);
const file = await getCommitFileDiff({ cwd: repoDir, sha, path: "feature.txt" });
expect(file?.path).toBe("feature.txt");
expect(file?.isNew).toBe(true);
expect(file?.additions).toBe(1);
expect(file?.deletions).toBe(0);
});
});