Skip to content

Commit 54e349d

Browse files
committed
Avoids starting PR queries on uncommitted changes
1 parent 1df29fc commit 54e349d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/annotations/lineAnnotationController.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ export class LineAnnotationController implements Disposable {
239239
.join()}`;
240240
}
241241

242+
let uncommittedOnly = true;
243+
242244
const commitPromises = new Map<string, Promise<void>>();
243245
const lines = new Map<number, GitLineState>();
244246
for (const selection of selections) {
@@ -252,6 +254,9 @@ export class LineAnnotationController implements Disposable {
252254
commitPromises.set(state.commit.ref, state.commit.ensureFullDetails());
253255
}
254256
lines.set(selection.active, state);
257+
if (!state.commit.isUncommitted) {
258+
uncommittedOnly = false;
259+
}
255260
}
256261

257262
const repoPath = trackedDocument.uri.repoPath;
@@ -269,6 +274,7 @@ export class LineAnnotationController implements Disposable {
269274
}
270275

271276
const getPullRequests =
277+
!uncommittedOnly &&
272278
repoPath != null &&
273279
cfg.pullRequests.enabled &&
274280
CommitFormatter.has(

0 commit comments

Comments
 (0)