Carthage/Carthage

Better error for misconfigured git submodule

開放

#2,572 建立於 2018年9月10日

 (1 則留言) (0 個反應) (0 位負責人)Swift (1,544 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (15,179 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Steps to reproduce

  1. mkdir tmp
  2. cd tmp
  3. git init
  4. echo 'github "antitypical/Result"'>Cartfile
  5. carthage update --use-submodules --no-build
  6. git add .
  7. git commit -m 'Initial'
  8. git rm Carthage/Checkouts/Result
  9. git reset HEAD .gitmodules
  10. git checkout -- .gitmodules
  11. git commit -m 'Bork it'
  12. carthage bootstrap --use-submodules --no-build

Expected A nice error that explains what you do and how to fix it or possibly even fix it automatically.

Fix:

  1. git submodule add -f {url to submodule} {path to submodule}
  2. git commit

Actual This unfriendly error. If you don't know to avoid doing the above, you definitely won't understand the error.

Parse error: expected submodule commit SHA in output of task (ls-tree -z HEAD Carthage/Checkouts/Result) but encountered:

貢獻者指南