Skip to content

Only reset remotes when fetching branches#5316

Merged
premun merged 3 commits into
dotnet:mainfrom
premun:prvysoky/fix-resetting-remotes
Sep 30, 2025
Merged

Only reset remotes when fetching branches#5316
premun merged 3 commits into
dotnet:mainfrom
premun:prvysoky/fix-resetting-remotes

Conversation

@premun

@premun premun commented Sep 29, 2025

Copy link
Copy Markdown
Member

Introduced in #5315 where we started resetting more even when checking out a SHA but it makes no sense to reset a SHA

Copilot AI review requested due to automatic review settings September 29, 2025 15:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where git operations were attempting to reset remotes even when working with non-branch refs (like tags or commit SHAs). The change adds a guard condition to only perform remote reset operations when an upstream branch actually exists.

Key changes:

  • Added a null/empty check for upstream branch before attempting reset operations
  • Removed redundant field declarations and assignments in PcsVmrBackFlower
  • Updated documentation to remove obsolete parameter reference

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
PcsVmrBackFlower.cs Removed duplicate field declarations that were already handled by base class
RepositoryCloneManager.cs Updated documentation to remove reference to removed parameter
CloneManager.cs Added null check for upstream branch before reset operations to prevent errors with non-branch refs

Comment thread src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/CloneManager.cs Outdated
@premun premun merged commit b3b2ce1 into dotnet:main Sep 30, 2025
9 checks passed
@premun premun deleted the prvysoky/fix-resetting-remotes branch September 30, 2025 08:20
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.

3 participants