#840: Git fetch doesn't work with multiple remotes - #2377
Open
Paras14 wants to merge 5 commits into
Open
Conversation
Collaborator
Coverage Report for CI Build 33180050789Coverage decreased (-0.03%) to 73.586%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions77 previously-covered lines in 2 files lost coverage.
Coverage Stats💛 - Coveralls |
Contributor
|
nice work on this @Paras14, i tested this on my machine and i looks great to me. can be move onto the next step |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #840
Implemented changes:
GitContextImpl.determineRemote. It rangit remote, which lists all remotes, and returnednullfor any repository with more than one. There is no single "default remote" in git for it to return.GitContext.getRemotesreturning theListof configured remotes.pullOrClonenow checksgetRemotes(repository).isEmpty(). Previously a repository with two remotes was reported as "a local git repository with no remote" and the user was asked whether to continue.fetchnow resolves a missing remote frombranch.<branch>.remote, falling back tooriginonly when no upstream is configured. This is the same remoteisRepositoryUpdateAvailablereads viagit rev-parse @{u}. Previouslyfetchalways fell back toorigin, so a branch tracking a different remote caused IDEasy to fetch one remote and compare against another, and it could report no settings update when one existed.Testing instructions
mvn clean test.GitContextTest.testRunGitPullWithMultipleRemotescovers a repository with two remotes and fails without this change.testRunGitPullWithoutRemoteAsksToContinuecovers a repository with no remote and verifies the question is still asked.Checklist for this PR
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary»In Progressand assigned to youinternalpom.xmlfiles