Sha256: 2c91011bfb6c0c0c08caa47fc7605b86d91e747ba4acb0cfaaaa324f526817ee

Contents?: true

Size: 564 Bytes

Versions: 33

Compression:

Stored size: 564 Bytes

Contents

require 'git/path'

module Git

  class Worktree < Path

    attr_accessor :full, :dir, :gcommit

    def initialize(base, dir, gcommit = nil)
      @full = dir
      @full += ' ' + gcommit if !gcommit.nil?
      @base = base
      @dir = dir
      @gcommit = gcommit
    end

    def gcommit
      @gcommit ||= @base.gcommit(@full)
      @gcommit
    end

    def add
      @base.lib.worktree_add(@dir, @gcommit)
    end

    def remove
      @base.lib.worktree_remove(@dir)
    end

    def to_a
      [@full]
    end

    def to_s
      @full
    end
  end
end

Version data entries

33 entries across 33 versions & 3 rubygems

Version Path
git-1.13.0 lib/git/worktree.rb
lg_pod_plugin-1.0.8 lib/git/worktree.rb
lg_pod_plugin-1.0.7 lib/git/worktree.rb
lg_pod_plugin-1.0.6 lib/git/worktree.rb
git-1.12.0 lib/git/worktree.rb
git-1.11.0 lib/git/worktree.rb
git-1.10.2 lib/git/worktree.rb
git-1.10.1 lib/git/worktree.rb
git-1.10.0 lib/git/worktree.rb
git-1.9.1 lib/git/worktree.rb
git-1.9.0 lib/git/worktree.rb
p-mongo-git-1.8.1 lib/git/worktree.rb
git-1.8.1 lib/git/worktree.rb