-
Notifications
You must be signed in to change notification settings - Fork 11
Fix checkout bug in GitRepositoryHelper #39
Conversation
… not checkout the *default branch* of the repository with the specified branch name, but it should checkout the actual remote branch
Thanks, @GeertvanHorrik. Just for future reference, this is an attempt to fix GitTools/GitVersion#1173. |
@asbjornu if you agree, feel free to merge, then we can release another beta of GV. |
@GeertvanHorrik: Sure, I'm just a bit concerned about this (GitTools/GitVersion#1173 (comment)):
Perhaps @JakeGinnivan can weigh in with his thoughts? |
That's just for the other change I proposed in there, it has nothing to do with this one ;-) This really is a required bug fix (whether or not we make the other change). |
@GeertvanHorrik: Ah, ok. I thought the tests in here were green because the test coverage is a bit low. In that case, merge incoming! 😄 👍 |
var repoTip = repo.Head.Tip; | ||
|
||
// We currently have the rep.Head of the *default* branch, now we need to look up the right one | ||
var originCanonicalName = string.Format("origin/{0}", currentBranch); |
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.
You should update this to use remote.Name
like everywhere else in this file
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.
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.
@JakeGinnivan Good point, will fix.
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.
Done.
Also can you put PR branches on forks @GeertvanHorrik, it keeps the main repo cleaner :) |
Will try to, I thought creating PR's in the first place would already keep things clean ;-) |
When a specific branch is specified in GitRepositoryHelper, it should not checkout the default branch of the repository with the specified branch name, but it should checkout the actual remote branch