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


8
9
10
11
12
# File 'lib/overcommit/git_config.rb', line 8

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

.hooks_pathObject


14
15
16
17
18
# File 'lib/overcommit/git_config.rb', line 14

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)
end