Skip to content

Prompt to push unpushed commits#8398

Merged
alexr00 merged 1 commit intomainfrom
alexr00/charming-smelt
Jan 16, 2026
Merged

Prompt to push unpushed commits#8398
alexr00 merged 1 commit intomainfrom
alexr00/charming-smelt

Conversation

@alexr00
Copy link
Member

@alexr00 alexr00 commented Jan 16, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 16, 2026 11:59
@alexr00 alexr00 enabled auto-merge (squash) January 16, 2026 11:59
@alexr00 alexr00 self-assigned this Jan 16, 2026
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 16, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a feature to prompt users to push unpushed commits before creating a pull request. When a user attempts to create a PR and their local branch has commits that haven't been pushed to the upstream remote, they are now presented with a modal dialog offering three options: push the commits, continue without pushing, or cancel the PR creation.

Changes:

  • Added fetch operation to get accurate ahead/behind count before PR creation
  • Added check for unpushed commits with user prompt
  • Added push operation when user chooses to push commits before creating PR
Comments suppressed due to low confidence (1)

src/github/createPRViewProvider.ts:1406

  • The push operation should have explicit error handling. If the push fails (e.g., due to network issues, permission problems, or conflicting changes on the remote), the error will bubble up to the catch block at line 1477, but this might provide unclear feedback to the user. Consider wrapping the push operation in a try-catch block to provide specific error messaging for push failures and allow the user to decide whether to retry, continue without pushing, or cancel the PR creation.
							await this._folderRepositoryManager.repository.push(compareBranch.upstream.remote, compareBranchName);

Comment on lines +1381 to +1386
// Fetch upstream to get accurate ahead/behind count
if (compareBranch.upstream) {
await this._folderRepositoryManager.repository.fetch(compareBranch.upstream.remote, compareBranch.upstream.name);
// Re-fetch branch info after fetch to get accurate ahead count
compareBranch = await this._folderRepositoryManager.repository.getBranch(compareBranchName);
}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fetch operation should be wrapped in error handling. Other fetch operations in the codebase (e.g., in folderRepositoryManager.ts:checkBranchUpToDate) handle potential errors such as deleted remote refs or connection issues. Consider adding try-catch error handling around this fetch operation to gracefully handle scenarios where the upstream remote might be unavailable or deleted.

This issue also appears in the following locations of the same file:

  • line 1406

Copilot uses AI. Check for mistakes.
@alexr00 alexr00 merged commit 0a966de into main Jan 16, 2026
12 checks passed
@alexr00 alexr00 deleted the alexr00/charming-smelt branch January 16, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants