Sha256: c1f5a40318679da299670131d6950b054c4f23aa908287ca10dbe350f88bf5bb

Contents?: true

Size: 743 Bytes

Versions: 9

Compression:

Stored size: 743 Bytes

Contents

module Git
  class Remote < Path
    
    attr_accessor :name, :url, :fetch_opts
    
    @base = nil
    
    def initialize(base, name)
      @base = base
      config = @base.lib.config_remote(name)
      @name = name
      @url = config['url']
      @fetch_opts = config['fetch']
    end
    
    def remove
      @base.remote_remove(@name)
    end
    
    def fetch
      @base.fetch(@name)
    end
    
    # merge this remote locally
    def merge(branch = 'master')
      @base.merge("#{@name}/#{branch}")
    end
    
    def branch(branch = 'master')
      Git::Branch.new(@base, "#{@name}/#{branch}")
    end
    
    def remove
      @base.lib.remote_remove(@name)     
    end
    
    def to_s
      @name
    end
    
  end
end

Version data entries

9 entries across 9 versions & 4 rubygems

Version Path
iownbey-git-1.0.7.1 lib/git/remote.rb
schacon-git-1.0.6 lib/git/remote.rb
schacon-git-1.0.7 lib/git/remote.rb
titanous-git-1.1.0 lib/git/remote.rb
git-1.0.1 lib/git/remote.rb
git-1.0.3 lib/git/remote.rb
git-1.0.2 lib/git/remote.rb
git-1.0.5 lib/git/remote.rb
git-1.0.4 lib/git/remote.rb