public
Description: The Git TextMate Bundle
Homepage: http://tim.theenchanter.com/
Clone URL: git://github.com/timcharper/git-tmbundle.git
git-tmbundle / Support / app / helpers / submodule_helper.rb
100644 22 lines (20 sloc) 0.489 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module SubmoduleHelper
  module Update
    flush
    def with_submodule_cacheing(&block)
      git.submodule.all.each { |m| m.cache }
      begin
        yield
      ensure
        git.submodule.all.each { |m| m.restore }
      end
      
      update_submodules_si_hay
    end
    
    def update_submodules_si_hay
      unless git.submodule.all.empty?
        puts "<br /><br /><h3>Updating submodules</h3>"
        puts htmlize(git.submodule.init_and_update)
      end
    end
  end
end