overcommit 0.49.1 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57eb73c3921856cf864136fbf263df0b07d1b07a6acc25a2c0fca6ed1d13a727
4
- data.tar.gz: 922db4b368ca43001b2118b2322dbcbb33686ebe8cd434375b52f7b4fc85be14
3
+ metadata.gz: f824ec83fa10a7b483e568728c32d9e2c15105d36bad7d76b4cb6ff3f162186e
4
+ data.tar.gz: a625d3bc126d5004119d534b31643ab5efc514b654f879afe2849816dd6eb673
5
5
  SHA512:
6
- metadata.gz: 795ef9d40b3652122d29c453e572e24d6c3ac363ff1f544d5fbfe806498233b3de445011b11ee5b8679c61796bedb5d69c68ff3e991f9db316e9bf4d01616104
7
- data.tar.gz: 91a0072f7c15479c5a78cca91082a32d99b3018cca244e54a10685abad1da8ac11d06193fda4c2434cad69119775d55370b887a4e012fb670917e43fd4f3811d
6
+ metadata.gz: 189cce42c8f838a56d74602acad8d549ee08734f11fcfd76f744a32c5b15799c35c0ee1316ec2fb3270679b07b70af97834e7e6ce38ec38d9301b0d0c22fc9fb
7
+ data.tar.gz: 136a4b200e1d74532c01a8b850b20f98624ba03cb6ef0e08bb633fcbd5cea86b1d730010fd7bd358fa2400497486003fa013b4d2d75106b26876eb565d15e45e
@@ -53,9 +53,11 @@ module Overcommit::HookContext
53
53
  @stash_attempted = true
54
54
 
55
55
  stash_message = "Overcommit: Stash of repo state before hook run at #{Time.now}"
56
- result = Overcommit::Utils.execute(
57
- %w[git -c commit.gpgsign=false stash save --keep-index --quiet] + [stash_message]
58
- )
56
+ result = Overcommit::Utils.with_environment('GIT_LITERAL_PATHSPECS' => '0') do
57
+ Overcommit::Utils.execute(
58
+ %w[git -c commit.gpgsign=false stash save --keep-index --quiet] + [stash_message]
59
+ )
60
+ end
59
61
 
60
62
  unless result.success?
61
63
  # Failure to stash in this case is likely due to a configuration
@@ -26,13 +26,23 @@ module Overcommit::HookLoader
26
26
 
27
27
  # Load and return a {Hook} from a CamelCase hook name.
28
28
  def create_hook(hook_name)
29
- Overcommit::Hook.const_get(@context.hook_class_name).
30
- const_get(hook_name).
31
- new(@config, @context)
32
- rescue LoadError, NameError => error
33
- raise Overcommit::Exceptions::HookLoadError,
34
- "Unable to load hook '#{hook_name}': #{error}",
35
- error.backtrace
29
+ hook_type_class = Overcommit::Hook.const_get(@context.hook_class_name)
30
+ hook_base_class = hook_type_class.const_get(:Base)
31
+ hook_class = hook_type_class.const_get(hook_name)
32
+ unless hook_class < hook_base_class
33
+ raise Overcommit::Exceptions::HookLoadError,
34
+ "Class #{hook_name} is not a subclass of #{hook_base_class}."
35
+ end
36
+
37
+ begin
38
+ Overcommit::Hook.const_get(@context.hook_class_name).
39
+ const_get(hook_name).
40
+ new(@config, @context)
41
+ rescue LoadError, NameError => error
42
+ raise Overcommit::Exceptions::HookLoadError,
43
+ "Unable to load hook '#{hook_name}': #{error}",
44
+ error.backtrace
45
+ end
36
46
  end
37
47
  end
38
48
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module Overcommit
5
- VERSION = '0.49.1'
5
+ VERSION = '0.50.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: overcommit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.49.1
4
+ version: 0.50.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane da Silva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-18 00:00:00.000000000 Z
11
+ date: 2019-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: childprocess
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 0.6.3
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '2.0'
22
+ version: '4'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 0.6.3
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '2.0'
32
+ version: '4'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: iniparse
35
35
  requirement: !ruby/object:Gem::Requirement