mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Resolve "fatal: not a git repository" error outside of git repositories
Summary: CocoaPods will display a "fatal: not a git repository" when these podspecs are consumed within Facebook's internal Mercurial repository due to the reliance on `git` to obtain the current commit hash. In these cases, the podspec is being consumed locally and the commit hash is unnecessary. The error is removed by avoiding the use of `git` if the current working directory is not a git repository (or any of the parent directories). Changelog: [Internal] [iOS] - Remove CocoaPods error within Facebook's repository Reviewed By: fkgozali Differential Revision: D27750974 fbshipit-source-id: 99159611c580baf5526f116948c5ff60e1c02e5c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e1eb938c9d
commit
ae07c53d0b
@@ -11,7 +11,7 @@ version = package['version']
|
||||
source = { :git => 'https://github.com/facebook/react-native.git' }
|
||||
if version == '1000.0.0'
|
||||
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
||||
source[:commit] = `git rev-parse HEAD`.strip
|
||||
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
||||
else
|
||||
source[:tag] = "v#{version}"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user