Class: Pushapp::Git

Inherits:
Object
  • Object
show all
Defined in:
lib/pushapp/git.rb

Instance Method Summary collapse

Instance Method Details

#update_tracked_repos(config) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/pushapp/git.rb', line 5

def update_tracked_repos config
  refs         = required_refs(config)
  current_refs = current_refs(config)

  new_refs    = new_refs(refs, current_refs)
  old_refs    = old_refs(refs, current_refs)

  new_refs.each do |r|
    Pushapp::Pipe.run("git config --add remote.#{r[0]}.url #{r[1]}")
  end

  old_refs.each do |r|
    Pushapp::Pipe.run("git config --unset remote.#{r[0]}.url #{r[1]}")
  end
end