Skip to content

Commit 952d94b

Browse files
committed
feat: add commit --fixup option to Repositories view
Add support for git commit --fixup in the Repositories view, allowing users to create fixup commits for interactive rebasing.
1 parent 3db4e45 commit 952d94b

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

src/env/node/git/sub-providers/operations.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,3 +402,16 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
402402
}
403403
}
404404
}
405+
406+
@log()
407+
async commitFixup(repoPath: string, ref: string): Promise<void> {
408+
const scope = getLogScope();
409+
410+
try {
411+
await this.git.exec({ cwd: repoPath, errors: GitErrorHandling.Throw }, 'commit', '--fixup', ref);
412+
this.container.events.fire('git:cache:reset', { repoPath: repoPath, types: ['status'] });
413+
} catch (ex) {
414+
Logger.error(ex, scope);
415+
throw ex;
416+
}
417+
}

src/git/gitProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ export interface GitOperationsSubProvider {
439439
options?: { mode?: 'hard' | 'keep' | 'merge' | 'mixed' | 'soft' },
440440
): Promise<void>;
441441
revert(repoPath: string, refs: string[], options?: { editMessage?: boolean }): Promise<void>;
442+
commitFixup?(repoPath: string, ref: string): Promise<void>;
442443
}
443444

444445
export interface GitPausedOperationsSubProvider {

0 commit comments

Comments
 (0)