Skip to content

Conversation

@a-nogikh
Copy link
Collaborator

There's no sense to react to git checkout or git fetch which failed due to network problems by re-cloning the whole repository - that operation will fail just as well.

Detect at least one kind of such problems and just return an error from the Poll() method, without wiping everything out.

For now, don't add tests as we would need some real remote git server implementation to properly test it. Using a folder as a "remote" repository, like we do in other tests, won't ever trigger networking errors.

Closes #6099.

There's no sense to react to `git checkout` or `git fetch` which failed
due to network problems by re-cloning the whole repository - that
operation will fail just as well.

Detect at least one kind of such problems and just return an error from
the Poll() method, without wiping everything out.

For now, don't add tests as we would need some real remote git server
implementation to properly test it. Using a folder as a "remote"
repository, like we do in other tests, won't ever trigger networking
errors.

Closes google#6099.
@a-nogikh a-nogikh requested a review from tarasmadan June 16, 2025 17:37
@a-nogikh a-nogikh added this pull request to the merge queue Jun 17, 2025
Merged via the queue into google:master with commit e77fae1 Jun 17, 2025
17 checks passed
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.

pkg/vcs: gitRepo.Poll is too eager to re-clone the checkout

2 participants