Skip to content

Commit 3aff869

Browse files
committed
Triggers an AI-powered rebase for unpushed changes
(#4443, #4522)
1 parent 2f9254f commit 3aff869

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/webviews/plus/graph/graphWebview.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3268,6 +3268,21 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
32683268
private aiRebaseUnpushed(item?: GraphItemContext) {
32693269
if (isGraphItemRefContext(item, 'branch')) {
32703270
const { ref } = item.webviewItemValue;
3271+
3272+
if (!ref.upstream) {
3273+
return Promise.resolve();
3274+
}
3275+
3276+
return executeCommand<GenerateRebaseCommandArgs>('gitlens.ai.generateRebase', {
3277+
repoPath: ref.repoPath,
3278+
head: ref,
3279+
base: createReference(ref.upstream.name, ref.repoPath, {
3280+
refType: 'branch',
3281+
name: ref.upstream.name,
3282+
remote: true,
3283+
}),
3284+
source: { source: 'graph' },
3285+
});
32713286
}
32723287

32733288
return Promise.resolve();

0 commit comments

Comments
 (0)