Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sds/overcommit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: docsend/overcommit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Mar 16, 2021

  1. Copy the full SHA
    f9472c6 View commit details
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/overcommit/configuration_loader.rb
10 changes: 7 additions & 3 deletions lib/overcommit/configuration_loader.rb
Original file line number Diff line number Diff line change
@@ -62,9 +62,7 @@ def load_repo_config

# Loads a configuration, ensuring it extends the default configuration.
def load_file(file)
config = self.class.load_from_file(file, default: false, logger: @log)
config = self.class.default_configuration.merge(config)

config = load_file_with_inheritance(file)
if @options.fetch(:verify) { config.verify_signatures? }
verify_signatures(config)
end
@@ -80,6 +78,12 @@ def load_file(file)

private

def load_file_with_inheritance(file)
config = self.class.load_from_file(file, default: false, logger: @log)
base_config = config['inherit_from'] ? load_file_with_inheritance(config['inherit_from']) : self.class.default_configuration
base_config.merge(config)
end

def verify_signatures(config)
if !config.previous_signature?
raise Overcommit::Exceptions::ConfigurationSignatureChanged,