File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,9 +62,7 @@ def load_repo_config
6262
6363 # Loads a configuration, ensuring it extends the default configuration.
6464 def load_file ( file )
65- config = self . class . load_from_file ( file , default : false , logger : @log )
66- config = self . class . default_configuration . merge ( config )
67-
65+ config = load_file_with_inheritance ( file )
6866 if @options . fetch ( :verify ) { config . verify_signatures? }
6967 verify_signatures ( config )
7068 end
@@ -80,6 +78,12 @@ def load_file(file)
8078
8179 private
8280
81+ def load_file_with_inheritance ( file )
82+ config = self . class . load_from_file ( file , default : false , logger : @log )
83+ base_config = config [ 'inherit_from' ] ? load_file_with_inheritance ( config [ 'inherit_from' ] ) : self . class . default_configuration
84+ base_config . merge ( config )
85+ end
86+
8387 def verify_signatures ( config )
8488 if !config . previous_signature?
8589 raise Overcommit ::Exceptions ::ConfigurationSignatureChanged ,
You can’t perform that action at this time.
0 commit comments