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 +4 -4
- data/lib/overcommit/hook_context/pre_commit.rb +5 -3
- data/lib/overcommit/hook_loader/base.rb +17 -7
- data/lib/overcommit/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f824ec83fa10a7b483e568728c32d9e2c15105d36bad7d76b4cb6ff3f162186e
|
4
|
+
data.tar.gz: a625d3bc126d5004119d534b31643ab5efc514b654f879afe2849816dd6eb673
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
57
|
-
|
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
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
data/lib/overcommit/version.rb
CHANGED
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.
|
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-
|
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: '
|
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: '
|
32
|
+
version: '4'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: iniparse
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|