Commit a8ee5c10 authored by Fabio Pelosin's avatar Fabio Pelosin

[Git] Use for the cache.

parent f6c1349e
...@@ -9,6 +9,11 @@ ...@@ -9,6 +9,11 @@
- Support for `header_mappings_dir` attribute in subspecs. - Support for `header_mappings_dir` attribute in subspecs.
- Refactored UI. - Refactored UI.
###### Bug fixes
- Improvements to the git cache that should be more robust.
[#517](https://github.com/CocoaPods/CocoaPods/issues/517)
## Master ## Master
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.14.0...master) [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.14.0...master)
......
...@@ -34,7 +34,7 @@ module Pod ...@@ -34,7 +34,7 @@ module Pod
ui_title " > Creating cache git repo (#{cache_path})" ui_title " > Creating cache git repo (#{cache_path})"
cache_path.rmtree if cache_path.exist? cache_path.rmtree if cache_path.exist?
cache_path.mkpath cache_path.mkpath
clone(url, cache_path) git! %Q|clone --mirror "#{url}" "#{cache_path}"|
end end
def prune_cache def prune_cache
...@@ -77,10 +77,14 @@ module Pod ...@@ -77,10 +77,14 @@ module Pod
def update_cache def update_cache
ui_title " > Updating cache git repo (#{cache_path})" ui_title " > Updating cache git repo (#{cache_path})"
Dir.chdir(cache_path) do Dir.chdir(cache_path) do
git! "reset --hard HEAD" if git("config core.bare").chomp == "true"
git! "clean -d -x -f" git! "remote update"
git! "pull origin master" else
git! "fetch --tags" git! "reset --hard HEAD"
git! "clean -d -x -f"
git! "pull origin master"
git! "fetch --tags"
end
end end
end end
......
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