-
Notifications
You must be signed in to change notification settings - Fork 72
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
Fix bug of Git shallow cloning is not used when branch is set #117
base: master
Are you sure you want to change the base?
Conversation
@dnkoutso I cleaned the branch and update the changelog |
@@ -222,6 +222,30 @@ def ensure_only_one_ref(folder) | |||
should.not.raise { downloader.download } | |||
end | |||
end | |||
|
|||
describe 'get remote default branch if not set branch with shallow clones' do | |||
it 'with git <= 2.10.x' do |
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.
where is this version enforced within the tests? I do not see it.
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 only try to follow the same way of this unit-test
cocoapods-downloader/spec/git_spec.rb
Line 202 in bce1d26
describe 'will retry if a remote does not support shallow clones' do |
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.
oh interesting, had no idea....curious how this happens.....
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.
@dimohamdy I checked out your branch and it seems even without your change the tests here are still passing? Can you confirm we are testing the right thing and these tests fail without your change?
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.
ping @dimohamdy for any updates here
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.
Hi @dnkoutso, Git shallow is working fine when branch is set. The real issue is caused by self.preprocess_option(options)
method. This method is deleting the :branch
option from options
, and add :commit
option into options
and after that it causing to pass adding --depth 1
parameter when git clone shallow_clone && !options[:commit]
. We should add test for preprocess_options
@dimohamdy Hi,I noticed the line of code you deleted:
The relevant code comes from a PR #57 , which is used to deal with the cache problem of cocoapods(:git && :branch). If you delete this line of code, it may affect the pod (:git && :branch) cache detection of cocoapods. I don’t know if you have tested these scenarios. |
Any chance, this gets merged? |
This would be useful to have 🙏 |
Fix #106