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

cocoapods checkout wrong branch if pod's branch name is separated by slashes #88

Closed
tripleCC opened this issue Apr 22, 2019 · 1 comment · Fixed by #98
Closed

cocoapods checkout wrong branch if pod's branch name is separated by slashes #88

tripleCC opened this issue Apr 22, 2019 · 1 comment · Fixed by #98
Labels
d1:easy help wanted Help from new or existing contributors would be greatly appreciated!

Comments

@tripleCC
Copy link

tripleCC commented Apr 22, 2019

Assume that pod A only has a branch named release/0.1.0.

...
pod 'A', git: 'xxx', branch: '0.1.0'
...

Install project with the Podfile above, and it will checkout release/0.1.0 branch.

def self.preprocess_options(options)
  return options unless options[:branch]

  command = ['ls-remote',
             options[:git],
             options[:branch]]
  output = Git.execute_command('git', command)  # will return release/0.1.0 branch
  match = /^([a-z0-9]*)\t.*/.match(output)

  return options if match.nil?

  options[:commit] = match[1]
  options.delete(:branch)

  options
end

I think /^([a-z0-9]*)\t.*/ is not strict for the case.

@dnkoutso
Copy link
Contributor

Please make a PR and add tests?

@amorde amorde added d1:easy help wanted Help from new or existing contributors would be greatly appreciated! labels Apr 22, 2019
@amorde amorde closed this as completed in #98 Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d1:easy help wanted Help from new or existing contributors would be greatly appreciated!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants