Class: DependencyBot::Git::Wrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/dependency_bot/git/wrapper.rb

Overview

This class is a wrapper around the Git gem to handle git operations. It checks out a branch, applies fixes, adds changes, and commits them. The class is used by DependencyBot to manage dependency updates in a repository. It is not intended to be used directly outside of the DependencyBot context. The class assumes that the current working directory is a valid git repository.

Class Method Summary collapse

Class Method Details

.run_and_commit(fixer) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/dependency_bot/git/wrapper.rb', line 13

def self.run_and_commit(fixer)
  g = ::Git.open(".")
  g.branch(fixer.branch_name).checkout
  fixer.fix
  g.add(".")
  g.commit(fixer.commit_message)
  g.push
  g.branch("-")
end