CocoaPods icon indicating copy to clipboard operation
CocoaPods copied to clipboard

>=1.16 cocoapods Podfile.lock hash mismatch on git worktree repo VS non worktree

Open FrederickEngelhardt opened this issue 1 year ago • 4 comments

Report

What did you do?

Run pod install in a repo. Run the same command in a git worktree repo. https://git-scm.com/docs/git-worktree

What did you expect to happen?

In 1.15.x pod install on a git worktree would not create a mismatching hash compared to a non worktree git repo containing a .git folder

What happened instead?

Pod install in a git worktree of a repo will install with a different hash for pods and update the Podfile.lock . This makes it hard to collaborate with people not on a worktree.

CocoaPods Environment

ℹ Please replace these two lines with the output of pod env. e.g. via pod env | pbcopy

Project that demonstrates the issue

ℹ Please link to a project we can download that reproduces the issue. You can delete this section if your issue is unrelated to build problems, i.e. it's only an issue with CocoaPods the tool.

FrederickEngelhardt avatar Jan 15 '25 01:01 FrederickEngelhardt

Having the same issue, looking for help 👀

canhth avatar Jan 24 '25 04:01 canhth

Likely caused by this change - rsync has the .git directory excluded.

Some pods are relying on git submodule update which is broken now.

Syn-McJ avatar Jan 24 '25 11:01 Syn-McJ

So, what should we do in this case? Does anyone have the solution yet?

canhth avatar Feb 19 '25 02:02 canhth

Any solutions? Git worktree is a really good feature for working with multiple branches.

rijieli avatar Jun 19 '25 02:06 rijieli