CocoaPods / cocoapods-downloader

A small library that provides downloaders for various source types (HTTP/SVN/Git/Mercurial)
MIT License
84 stars 71 forks source link

fix chinese branch name download error #109

Closed xdkhan closed 3 years ago

xdkhan commented 3 years ago

if use chinese branch name, download error.

eg.

pod 'Kingfisher', git:'https://github.com/xdkhan/Kingfisher.git', :branch=>'中文分支' 

then pod install, error:

[!] Failed to download 'Kingfisher': incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)

error reason

      def self.commit_from_ls_remote(output, branch_name)
        return nil if branch_name.nil?

        # output encoding type: ASCII-8BIT
        # branch_name encoding type: UTF-8

        match = %r{([a-z0-9]*)\trefs\/(heads|tags)\/#{Regexp.quote(branch_name)}}.match(output)
        match[1] unless match.nil?
      end
xdkhan commented 3 years ago

travis-ci is error.

截屏2021-03-14 下午9 57 34
dnkoutso commented 3 years ago

@xdkhan can you please add a test and a changelog entry? Thanks!

dnkoutso commented 3 years ago

superseded by https://github.com/CocoaPods/cocoapods-downloader/pull/116