Sha256: 31330041346f637ec1e41c4579f9c8a79285331df27d0455508bccc32fd9dfae

Contents?: true

Size: 682 Bytes

Versions: 4

Compression:

Stored size: 682 Bytes

Contents

module Git
  class Remote < Path

    attr_accessor :name, :url, :fetch_opts

    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

4 entries across 4 versions & 1 rubygems

Version Path
minad-git-1.1.1 lib/git/remote.rb
minad-git-1.1.2 lib/git/remote.rb
minad-git-1.1.3 lib/git/remote.rb
minad-git-1.1.5 lib/git/remote.rb