-
Notifications
You must be signed in to change notification settings - Fork 914
Choose between multiple remotes instead of showing an error #8922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Choose between multiple remotes instead of showing an error #8922
Conversation
Move "Add remote" action close to "Clone" action
|
I will do a correct squash and merge at the end. Unfortunately I merged master after my commit. Sry for that. |
|
I also added a null check, due to a NPE throwing. I see failing tests, I will fix them soon. |
|
Seemed that there are no failing tests, pipeline had a hickup probably. |
matthiasblaesing
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay in reviewing this. The Change looks fine to me. I only eyeballed this, so I have to assume this was tested by you.
I left to inline comments, that are more questions to confirm my assumptions.
Before merging please rebase this onto master and retest. Intermediate merges from master make it unnecessary hard to revert if necessary (we learnt that the hard way). As rebasing is not clean and the changes are small, I think this might be a good alternative would be:
- rename your local branch of this PR
- checkout current master and recreate the branch
feature/git-multi-remote-solutionfrom that - apply the changes onto that
git diff a2a2958133b0d6ce07519419d56bf8fdbbfec201..dfc9ce9f6ff5 | git apply(a2a2958 is the last state of master you merged intofeature/git-multi-remote-solution, dfc9ce9 is the original head offeature/git-multi-remote-solution)
| } | ||
|
|
||
| public void fillRemoteBranches (final Map<String, GitBranch> branches, final GitBranch branchToSelect) { | ||
| fillRemoteBranchesInternal(Collections.<String,GitBranch>emptyMap(), Collections.<String,GitBranch>emptyMap(), null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the intention here to start with an empty list in any case and then update when loading is done? That might be worth a comment.
I was wondering why null is passed here as branchToSelect. That makes only sense to me, if we just want to initialize.
| GitBranch activeBranch = info.getActiveBranch(); | ||
| if (activeBranch != null && activeBranch.getTrackedBranch() == null) { | ||
| // branchToMerge is the remote branch name (e.g., "origin/master") | ||
| if (shallSetupTracking(activeBranch, branchToMerge)) { | ||
| SystemAction.get(SetTrackingAction.class).setupTrackedBranchImmediately( | ||
| repository, activeBranch.getName(), branchToMerge); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I correct in assuming, that this not called on the EDT?
If you have add more than one remote and you want to push an untracked branch, NetBeans just shows an error that it can't choose the correct remote due to many remotes.
I added this for push to upstream and pull from upstream. If we have multiple remotes, it just opens the same UI for pull/push and preselect the current branch.
For push it will also ask for setting this branch tracked to the remote branch. I have a problem for doing the same for pull. I guess it is a thread thing.
Inside of PullAction in the method perform, it never hits the finally block, due to removing the threadlocal variable inside the runWithoutInding method. I dunno whether this is a bug but for me it feels like that. So I couldn't test it.
The PR is not finished yet, but you already can have a look and left comments please.
PR approval and merge checklist:
If this PR targets the delivery branch: don't merge. (full wiki article)