Module: Overcommit::GitConfig

Defined in:
lib/overcommit/git_config.rb

Overview

Get configuration options from git

Class Method Summary collapse

Class Method Details

.comment_characterObject



10
11
12
13
14
# File 'lib/overcommit/git_config.rb', line 10

def comment_character
  char = `git config --get core.commentchar`.chomp
  char = '#' if char == ''
  char
end

.hooks_pathObject



16
17
18
19
20
21
# File 'lib/overcommit/git_config.rb', line 16

def hooks_path
  path = `git config --get core.hooksPath`.chomp
  return File.join(Overcommit::Utils.git_dir, 'hooks') if path.empty?

  File.absolute_path(path, Dir.pwd)
end