From ef4347b898520053ff7b4b1a3f0eaae80b7a4f9f Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 18 Dec 2014 12:57:37 -0500 Subject: [PATCH] Start versioning cached git clones --- Library/Homebrew/download_strategy.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 65d47c1612..9e3f29d441 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -534,6 +534,10 @@ class GitDownloadStrategy < VCSDownloadStrategy "git" end + def cache_version + 0 + end + def update cached_location.cd do config_repo @@ -600,7 +604,10 @@ class GitDownloadStrategy < VCSDownloadStrategy def clone_repo safe_system 'git', *clone_args - cached_location.cd { update_submodules } if submodules? + cached_location.cd do + safe_system "git", "config", "homebrew.cacheversion", cache_version + update_submodules if submodules? + end end def checkout