lib/vendorise/arborist.rb in vendorise-0.2.0 vs lib/vendorise/arborist.rb in vendorise-0.3.0
- old
+ new
@@ -1,19 +1,20 @@
module Vendorise
class Arborist
- attr_reader :path, :url
+ attr_reader :path, :url, :branch
- def initialize(path, url)
+ def initialize(path, url, branch)
@path = path
@url = url
+ @branch = branch
end
def subtree_already_exists?
Dir.exist?(path)
end
def subtree_command
cmd = subtree_already_exists? ? "pull" : "add"
- "git subtree #{cmd} --prefix #{path} #{url} master --squash"
+ "git subtree #{cmd} --prefix #{path} #{url} #{branch} --squash"
end
end
end