Git - fix regression related to editing the merge commit message (#241061)

This commit is contained in:
Ladislau Szomoru
2025-02-18 10:31:00 +01:00
committed by GitHub
parent 80b20f33e7
commit 60240d261a
4 changed files with 5 additions and 32 deletions

View File

@@ -262,7 +262,6 @@ export class ActionButton {
const isCommitInProgress =
this.repository.operations.isRunning(OperationKind.Commit) ||
this.repository.operations.isRunning(OperationKind.PostCommitCommand) ||
this.repository.operations.isRunning(OperationKind.MergeContinue) ||
this.repository.operations.isRunning(OperationKind.RebaseContinue);
const isSyncInProgress =

View File

@@ -1896,16 +1896,6 @@ export class Repository {
await this.exec(['merge', '--abort']);
}
async mergeContinue(): Promise<void> {
const args = ['merge', '--continue'];
try {
await this.exec(args, { env: { GIT_EDITOR: 'true' } });
} catch (commitErr) {
await this.handleCommitError(commitErr);
}
}
async tag(options: { name: string; message?: string; ref?: string }): Promise<void> {
let args = ['tag'];

View File

@@ -39,7 +39,6 @@ export const enum OperationKind {
Merge = 'Merge',
MergeAbort = 'MergeAbort',
MergeBase = 'MergeBase',
MergeContinue = 'MergeContinue',
Move = 'Move',
PostCommitCommand = 'PostCommitCommand',
Pull = 'Pull',
@@ -70,10 +69,10 @@ export type Operation = AddOperation | ApplyOperation | BlameOperation | BranchO
DeleteRefOperation | DeleteRemoteRefOperation | DeleteTagOperation | DiffOperation | FetchOperation | FindTrackingBranchesOperation |
GetBranchOperation | GetBranchesOperation | GetCommitTemplateOperation | GetObjectDetailsOperation | GetObjectFilesOperation | GetRefsOperation |
GetRemoteRefsOperation | HashObjectOperation | IgnoreOperation | LogOperation | LogFileOperation | MergeOperation | MergeAbortOperation |
MergeBaseOperation | MergeContinueOperation | MoveOperation | PostCommitCommandOperation | PullOperation | PushOperation | RemoteOperation |
RenameBranchOperation | RemoveOperation | ResetOperation | RebaseOperation | RebaseAbortOperation | RebaseContinueOperation | RefreshOperation |
RevertFilesOperation | RevListOperation | RevParseOperation | SetBranchUpstreamOperation | ShowOperation | StageOperation | StatusOperation |
StashOperation | SubmoduleUpdateOperation | SyncOperation | TagOperation;
MergeBaseOperation | MoveOperation | PostCommitCommandOperation | PullOperation | PushOperation | RemoteOperation | RenameBranchOperation |
RemoveOperation | ResetOperation | RebaseOperation | RebaseAbortOperation | RebaseContinueOperation | RefreshOperation | RevertFilesOperation |
RevListOperation | RevParseOperation | SetBranchUpstreamOperation | ShowOperation | StageOperation | StatusOperation | StashOperation |
SubmoduleUpdateOperation | SyncOperation | TagOperation;
type BaseOperation = { kind: OperationKind; blocking: boolean; readOnly: boolean; remote: boolean; retry: boolean; showProgress: boolean };
export type AddOperation = BaseOperation & { kind: OperationKind.Add };
@@ -108,7 +107,6 @@ export type LogFileOperation = BaseOperation & { kind: OperationKind.LogFile };
export type MergeOperation = BaseOperation & { kind: OperationKind.Merge };
export type MergeAbortOperation = BaseOperation & { kind: OperationKind.MergeAbort };
export type MergeBaseOperation = BaseOperation & { kind: OperationKind.MergeBase };
export type MergeContinueOperation = BaseOperation & { kind: OperationKind.MergeContinue };
export type MoveOperation = BaseOperation & { kind: OperationKind.Move };
export type PostCommitCommandOperation = BaseOperation & { kind: OperationKind.PostCommitCommand };
export type PullOperation = BaseOperation & { kind: OperationKind.Pull };
@@ -166,7 +164,6 @@ export const Operation = {
Merge: { kind: OperationKind.Merge, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as MergeOperation,
MergeAbort: { kind: OperationKind.MergeAbort, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as MergeAbortOperation,
MergeBase: { kind: OperationKind.MergeBase, blocking: false, readOnly: true, remote: false, retry: false, showProgress: true } as MergeBaseOperation,
MergeContinue: { kind: OperationKind.MergeContinue, blocking: true, readOnly: false, remote: false, retry: false, showProgress: true } as MergeAbortOperation,
Move: { kind: OperationKind.Move, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as MoveOperation,
PostCommitCommand: { kind: OperationKind.PostCommitCommand, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as PostCommitCommandOperation,
Pull: { kind: OperationKind.Pull, blocking: true, readOnly: false, remote: true, retry: true, showProgress: true } as PullOperation,

View File

@@ -1294,20 +1294,7 @@ export class Repository implements Disposable {
const workingGroupResources = opts.all && opts.all !== 'tracked' ?
[...this.workingTreeGroup.resourceStates.map(r => r.resourceUri.fsPath)] : [];
if (this.mergeInProgress) {
await this.run(
Operation.MergeContinue,
async () => {
if (opts.all) {
const addOpts = opts.all === 'tracked' ? { update: true } : {};
await this.repository.add([], addOpts);
}
await this.repository.mergeContinue();
await this.commitOperationCleanup(message, indexResources, workingGroupResources);
},
() => this.commitOperationGetOptimisticResourceGroups(opts));
} else if (this.rebaseCommit) {
if (this.rebaseCommit) {
await this.run(
Operation.RebaseContinue,
async () => {