合并后的子模块中运行Pod安装后githooks的仓库URL不正确

时间:2019-02-20 20:05:11

标签: xcode git cocoapods githooks podspec

我有一个脚本用于在测试项目上运行pod install,并且在本地运行时可以正常工作。当我将脚本放入github后合并脚本时,它将更改我的回购协议的远程URL。似乎占用了子模块配置的内容。

这是我的子模块的配置:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = true
    worktree = ../../../../Externals/MyAwesomeRepo
[remote "origin"]
    url = git@github.com:MyRepo/MyAwesomeRepo.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "test-branch"]
    remote = origin
    merge = refs/heads/test-branch

这是pod repo在本地运行时的结果(一切看起来不错):

myPods
- Type: git (master)
- URL:  https://github.com/MyRepo/myPods.git
- Path: /Users/myname/.cocoapods/repos/MyRepo

master
- Type: git (master)
- URL:  https://github.com/CocoaPods/Specs.git
- Path: /Users/myname/.cocoapods/repos/master

这是pod repo通过post-merge脚本运行时的结果(请参阅类型错误以及url与配置中的匹配):

myPods
- Type: git (test-branch)
- URL:  git@github.com:MyRepo/MyAwesomeRepo.git
- Path: /Users/myname/.cocoapods/repos/MyRepo

master
- Type: git (test-branch)
- URL:  git@github.com:MyRepo/MyAwesomeRepo.git
- Path: /Users/myname/.cocoapods/repos/master

0 个答案:

没有答案