Skip to content

Commit fb4e98b

Browse files
committed
Triggers an AI-powered rebase for unpushed changes
(#4443, #4522)
1 parent edec9c0 commit fb4e98b

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
@@ -3271,6 +3271,21 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
32713271
private aiRebaseUnpushed(item?: GraphItemContext) {
32723272
if (isGraphItemRefContext(item, 'branch')) {
32733273
const { ref } = item.webviewItemValue;
3274+
3275+
if (!ref.upstream) {
3276+
return Promise.resolve();
3277+
}
3278+
3279+
return executeCommand<GenerateRebaseCommandArgs>('gitlens.ai.generateRebase', {
3280+
repoPath: ref.repoPath,
3281+
head: ref,
3282+
base: createReference(ref.upstream.name, ref.repoPath, {
3283+
refType: 'branch',
3284+
name: ref.upstream.name,
3285+
remote: true,
3286+
}),
3287+
source: { source: 'graph' },
3288+
});
32743289
}
32753290

32763291
return Promise.resolve();

0 commit comments

Comments
 (0)