Порівняти коміти

...
Автор SHA1 Повідомлення Дата
l0ng-ai ced8655afe fix(vcs): load no Amend message with several repositories
With several roots, Amend loaded HEAD's message of the repository last
selected in the branch widget, log or push dialog, whatever the included
files were, and the commit then amended every included repository with
it. As in IDEA, the commit to amend is ambiguous there: no message is
loaded, and the one typed amends each repository's HEAD.

Fixes #6149
2026-11-26 20:09:01 +08:00
2 змінених файлів з 13 додано та 0 видалено

No files matched your search

+10
Переглянути файл
@@ -221,6 +221,16 @@ describe("commit message draft (#4423)", () => {
expect(useCommit.getState()).toMatchObject({ author: "", authorDate: scoped.authorDate, amend: false });
});
it("loads no message for Amend with several repositories (#6149)", async () => {
useVcs.setState({ root: "/a", roots: ["/a", "/a/b"] });
type("my draft");
await setAmend(true);
expect(vcsLog).not.toHaveBeenCalled();
expect(useCommit.getState()).toMatchObject({ amend: true, message: "my draft" });
await setAmend(false);
expect(useCommit.getState()).toMatchObject({ amend: false, message: "my draft" });
});
it("keeps the typed draft, not the amended commit's message, while Amend is on", async () => {
type("my draft");
flushDraft();
+3
Переглянути файл
@@ -449,6 +449,9 @@ export async function setAmend(on: boolean, target: EarlierAmend | null = null)
if (data) scheduleDraft();
return;
}
// With several repositories the commit to amend is ambiguous: as in IDEA, no message is
// loaded, and the one typed amends each repository's HEAD.
if (!target && roots.length > 1) return;
const current = () => request === amendRequest && useCommit.getState().amend && useVcs.getState().root === project;
let head = target?.commit;
try {