4 class GitAdapter < AbstractAdapter
6 COMMITTER_NAME = 'ohloh_slave' unless defined?(COMMITTER_NAME)
9 logger.info { "Pushing to #{to.url}" }
12 ENV['GIT_COMMITTER_NAME'] = COMMITTER_NAME
13 run "cd '#{self.url}' && git push '#{to.url}' #{self.branch_name}:#{to.branch_name}"
16 # Create a new repo on the same local machine. Just use existing pull code in reverse.
19 run "ssh #{to.hostname} 'mkdir -p #{to.path}'"
20 run "scp -rpqB #{git_path} #{to.hostname}:#{to.path}"
26 return true if hostname == Socket.gethostname
27 return false if url =~ /:/
32 url =~ /^([^:^\/]+):(.+)/ ? $1 : nil
36 url =~ /^([^:^\/]+):(.+)/ ? $2 : nil