-
Notifications
You must be signed in to change notification settings - Fork 656
Skip creation of HEAD branch when creating local branches #286
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
Conversation
This relates to the issue which was raised here #284 @nulltoken, can you take a look and let me know what you think? If I have understood the problem, then I have simply done a very simple check to ensure that the HEAD branch isn't created locally. I have created a "hooky" version of GitVersion and installed on AppVeyor, and it certainly seems to work. You can see the output of the build here: https://ci.appveyor.com/project/GaryEwanPark/webapisample/build/0.2.0-unstable.23+23%20(Build%2034) NOTE Yes, I like foxes, I name all my branches suffixed with Fox, this was in no way a typo :-) |
@@ -176,6 +176,13 @@ static void CreateMissingLocalBranchesFromRemoteTrackingOnes(Repository repo, st | |||
foreach (var remoteTrackingReference in repo.Refs.FromGlob(prefix + "*")) | |||
{ | |||
var localCanonicalName = "refs/heads/" + remoteTrackingReference.CanonicalName.Substring(prefix.Length); | |||
|
|||
if (localCanonicalName.EndsWith("HEAD")) |
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.
I'd rather see an explicit equality check here rather than an "ends with".
Couldn't you first build up the expected HEAD canonical name (eg. 'refs/remotes/' + remoteName + '/HEAD') and suppress it from the foreach enumeration through a negative .Where() call?
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.
Yip, that makes sense. Will take a look at lunch time 👍
@nulltoken I have implemented your suggestion, and it works as expected. Build working here: https://ci.appveyor.com/project/GaryEwanPark/webapisample/build/0.2.0-unstable.25+25%20(Build%2036) Thoughts? |
@gep13 You rock! nitpick: i'd recommend to squash the two commits as they relate to the same logical change orherwise 👍 for me. @JakeGinnivan @SimonCropp ? |
Otherwise looks good |
c852fc6
to
c3d25d3
Compare
Done |
- Based on a suggestion from @nulltoken, skipping the creation of the HEAD branch, if it exists in the list of branches to create. - This was causing an issue when running on AppVeyor - This can be seen working here: https://ci.appveyor.com/project/GaryEwanPark/webapisample/build/0.2.0-unstable.23+23%20(Build%2034)
c3d25d3
to
0bc9155
Compare
Done |
Skip creation of HEAD branch when creating local branches
Sweet! Do you know when you are planning the next release? Sent from my Windows Phone From: Simon Croppmailto:[email protected] Merged #286. Reply to this email directly or view it on GitHub: |
i dumped it in 1.4. prob on the weekend. |
Cool, no immediate rush, just curious about timescale. I will use my hooky copy for now :-) Sent from my Windows Phone From: Simon Croppmailto:[email protected] i dumped it in 1.4. prob on the weekend. Reply to this email directly or view it on GitHub: |
@SimonCropp just wanted to touch base on this. Are you pushing a new release this weekend? Or will it be later? Just wanted to know whether I can get rid of my hooky copy. Thanks! |
done. it is still the weekend somewhere right? |
It is quickly running out here in the UK :-P I have just approved the package on Chocolatey.org, so it is good to go :-) |
https://ci.appveyor.com/project/GaryEwanPark/webapisample/build/0.2.0-unstable.23+23%20(Build%2034)