From 6d074bd7b36066bba4ef2161fd34ac17e48a5c96 Mon Sep 17 00:00:00 2001 From: Yen-Chia Lin Date: Tue, 7 Sep 2021 14:19:34 +0200 Subject: [PATCH] Fix "can't modify frozen string" errors when pods are integrated using the `branch` option (#10920) --- CHANGELOG.md | 5 +++-- lib/cocoapods-downloader/git.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b35d946..35d7dba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,9 @@ ##### Bug Fixes -* None. - +* Fix "can't modify frozen string" errors when pods are integrated using the `branch` option + [buju77](https://github.com/Buju77) + [#10920](https://github.com/CocoaPods/CocoaPods/issues/10920) ## 1.5.0 (2021-08-31) diff --git a/lib/cocoapods-downloader/git.rb b/lib/cocoapods-downloader/git.rb index f7914e6..bd93cf2 100644 --- a/lib/cocoapods-downloader/git.rb +++ b/lib/cocoapods-downloader/git.rb @@ -52,7 +52,7 @@ def self.preprocess_options(options) # def self.commit_from_ls_remote(output, branch_name) return nil if branch_name.nil? - encoded_branch_name = branch_name.force_encoding(Encoding::ASCII_8BIT) + encoded_branch_name = branch_name.encode(Encoding::ASCII_8BIT) match = %r{([a-z0-9]*)\trefs\/(heads|tags)\/#{Regexp.quote(encoded_branch_name)}}.match(output) match[1] unless match.nil? end