Commit a8ee5c10 authored by Fabio Pelosin's avatar Fabio Pelosin

[Git] Use for the cache.

parent f6c1349e
......@@ -9,6 +9,11 @@
- Support for `header_mappings_dir` attribute in subspecs.
- Refactored UI.
###### Bug fixes
- Improvements to the git cache that should be more robust.
[#517](https://github.com/CocoaPods/CocoaPods/issues/517)
## Master
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.14.0...master)
......
......@@ -34,7 +34,7 @@ module Pod
ui_title " > Creating cache git repo (#{cache_path})"
cache_path.rmtree if cache_path.exist?
cache_path.mkpath
clone(url, cache_path)
git! %Q|clone --mirror "#{url}" "#{cache_path}"|
end
def prune_cache
......@@ -77,12 +77,16 @@ module Pod
def update_cache
ui_title " > Updating cache git repo (#{cache_path})"
Dir.chdir(cache_path) do
if git("config core.bare").chomp == "true"
git! "remote update"
else
git! "reset --hard HEAD"
git! "clean -d -x -f"
git! "pull origin master"
git! "fetch --tags"
end
end
end
def ref_exists?(ref)
Dir.chdir(cache_path) { git "rev-list --max-count=1 #{ref}" }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment