Skip to content
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

Set refs/remotes/origin/HEAD to default branch when branch is specified #6010

Merged
merged 3 commits into from Aug 26, 2021
Merged

Set refs/remotes/origin/HEAD to default branch when branch is specified #6010

merged 3 commits into from Aug 26, 2021

Conversation

ghost
Copy link

@ghost ghost commented Aug 26, 2021

Another attempt to fix #5751.

I have first reverted the previous attempt and re-introduced changes that seem to work correctly.

I had to close the original pull request #5791 and open a new one because it was completely forgotten.

@@ -172,7 +172,7 @@ void test_clone_nonetwork__can_checkout_given_branch(void)

cl_git_pass(git_reference_lookup(&remote_head, g_repo, "refs/remotes/origin/HEAD"));
Copy link
Member

@ethomson ethomson Aug 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on #5791, it looks like git does not create refs/remotes/origin/HEAD at all when --single-branch is specified. Do we have a --single-branch analog where we should we follow suit?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review! 😊 I don't remember if I checked that (for some reason I think that we've decided to check git --single-branch because that was already the behavior in libgit2), so I'm going to do another test and see if we already follow the suit 👍

@ethomson
Copy link
Member

Sorry for the delay in reviewing this - I appreciate you bumping it up to the top of the list!

@ethomson
Copy link
Member

This looks good to me - thanks for working on this!

@ethomson ethomson merged commit 3f8bf8b into libgit2:main Aug 26, 2021
@ghost ghost deleted the a-ovchin/remote-head-branch-clone branch August 27, 2021 08:49
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.

refs/remotes/origin/HEAD is not created when cloning a branch
1 participant