rabbitt-githooks 1.5.3 → 1.5.4
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/Gemfile.lock +1 -1
- data/lib/githooks/hook.rb +10 -3
- data/lib/githooks/repository.rb +7 -5
- data/lib/githooks/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 537d8b0aba4a78077a2a83811f61275e92675096
|
4
|
+
data.tar.gz: 35f7835256d75573db5d1e2ab1390b0b9dba7e91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0a01ba51f8a80696f79fd3f1acac240419cc59d032b65473c5b9ba98808c7222f062fe31b4bf6a3fe3f9b22cdc9c96d7ebe2c0acb4953faa8ee4906e0c10758
|
7
|
+
data.tar.gz: 5da65f00da85068723387ff697f53feb488d1f2418021de602b4a22258282f3471f60772c9ea455b499361f55d79cbeb0b58a2e97e511035d195fde4c0647368
|
data/Gemfile.lock
CHANGED
data/lib/githooks/hook.rb
CHANGED
@@ -173,7 +173,7 @@ module GitHooks
|
|
173
173
|
@hook.repository
|
174
174
|
end
|
175
175
|
|
176
|
-
def files
|
176
|
+
def files # rubocop:disable Metrics/AbcSize
|
177
177
|
@files ||= begin
|
178
178
|
options = {
|
179
179
|
staged: hook.staged,
|
@@ -182,8 +182,15 @@ module GitHooks
|
|
182
182
|
}
|
183
183
|
|
184
184
|
if %w[ commit-msg pre-push ].include? hook.phase
|
185
|
-
|
186
|
-
|
185
|
+
begin
|
186
|
+
if (parent_sha = repository.last_unpushed_commit_parent)
|
187
|
+
options.merge!(ref: parent_sha)
|
188
|
+
end
|
189
|
+
rescue Error::RemoteNotSet
|
190
|
+
# remote not set yet, so let's only focus on what's tracked for now
|
191
|
+
options[:tracked] = true
|
192
|
+
options[:untracked] = false
|
193
|
+
options[:staged] = false
|
187
194
|
end
|
188
195
|
end
|
189
196
|
|
data/lib/githooks/repository.rb
CHANGED
@@ -60,11 +60,13 @@ module GitHooks
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def get_root_path(path)
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
63
|
+
@root_path ||= begin
|
64
|
+
git('rev-parse', '--show-toplevel', chdir: path).tap do |result|
|
65
|
+
unless result.status.success? && result.output !~ /not a git repository/i
|
66
|
+
fail Error::NotAGitRepo, "Unable to find a valid git repo in #{path}"
|
67
|
+
end
|
68
|
+
end.output.strip
|
69
|
+
end
|
68
70
|
end
|
69
71
|
|
70
72
|
def stash
|
data/lib/githooks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbitt-githooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl P. Corliss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|