Method: Docman::GitUtil.commit

Defined in:
lib/docman/git_util.rb

.commit(root_path, path, message, tag = nil) ⇒ Object



81
82
83
84
85
86
87
88
89
# File 'lib/docman/git_util.rb', line 81

def self.commit(root_path, path, message, tag = nil)
  if repo_changed? path
    pull root_path
    exec %Q(add --all #{path.slice "#{root_path}/"})
    exec %Q(commit -m "#{message}") if repo_changed? path
    self.tag(root_path, tag) if tag
    Docman::Application.instance.commit_count = Docman::Application.instance.commit_count + 1
  end
end