Skip to content

Commit 6e4d0d2

Browse files
committed
Triggers an AI-powered rebase for unpushed changes
(#4443, #4522)
1 parent 43aca18 commit 6e4d0d2

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
@@ -3301,6 +3301,21 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
33013301
private aiRebaseUnpushed(item?: GraphItemContext) {
33023302
if (isGraphItemRefContext(item, 'branch')) {
33033303
const { ref } = item.webviewItemValue;
3304+
3305+
if (!ref.upstream) {
3306+
return Promise.resolve();
3307+
}
3308+
3309+
return executeCommand<GenerateRebaseCommandArgs>('gitlens.ai.generateRebase', {
3310+
repoPath: ref.repoPath,
3311+
head: ref,
3312+
base: createReference(ref.upstream.name, ref.repoPath, {
3313+
refType: 'branch',
3314+
name: ref.upstream.name,
3315+
remote: true,
3316+
}),
3317+
source: { source: 'graph' },
3318+
});
33043319
}
33053320

33063321
return Promise.resolve();

0 commit comments

Comments
 (0)