overcommit 0.48.0 → 0.48.1

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: 9daaca7072540df4bd522b92ad834538848ed7e7baa2cda6a545574ba1aeb494
4
- data.tar.gz: 0a47820c56e90b7598eb09e6d51d9a64e3fc6b8b56e6c4cb4dcd9b6afd7711d8
3
+ metadata.gz: d2d560865c5f4d0d10103a9a76e8447e84d93890b768dbcaa689d896fd144c5e
4
+ data.tar.gz: 96bd78d4139356c2ef0ff89dd64750e8df602b6609bf01249c560c5c0a4c121a
5
5
  SHA512:
6
- metadata.gz: 0c5b567931123d658f76566c5154ab574923b9b6a3c7530c83d1c36fc05b0e42021f58837e0f1edd59b00ec00382c43b3ec5cccbafb5001fa8aeb8fb591b7210
7
- data.tar.gz: d09e08f4ca81501c4d530600896c04981c12c55353753e692b4e64126a7de4ee79084864ead0ab4c670cb47c3d868e26976a402795ee111e4ac983baa598d888
6
+ metadata.gz: 3b5dbeccbcaba03c4845367d45cc0ba72fee1af4f523bc315e35118ac7e35444308e5925a3d6c26cd7ecbc9da33ac36863a8b28b7185a770581b252c9248409b
7
+ data.tar.gz: 398c42bf237a8d7c7d1388dfab5814504a621dcf78fc8ed4557645bf330b71da05ef9d4ee7ef9825e15bf1abd7515a4aa4ca09c84a13c447a4c8ad06b339378d
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'iniparse'
4
+ require 'shellwords'
4
5
 
5
6
  module Overcommit
6
7
  # Provide a set of utilities for certain interactions with `git`.
@@ -108,7 +109,13 @@ module Overcommit
108
109
  # @return [Array<String>] list of absolute file paths
109
110
  def list_files(paths = [], options = {})
110
111
  ref = options[:ref] || 'HEAD'
111
- path_list = paths.empty? ? '' : "\"#{paths.join('" "')}\""
112
+ path_list =
113
+ if OS.windows?
114
+ paths = paths.map { |path| path.gsub('"', '""') }
115
+ paths.empty? ? '' : "\"#{paths.join('" "')}\""
116
+ else
117
+ paths.shelljoin
118
+ end
112
119
  `git ls-tree --name-only #{ref} #{path_list}`.
113
120
  split(/\n/).
114
121
  map { |relative_file| File.expand_path(relative_file) }.
@@ -8,7 +8,7 @@ module Overcommit::Hook::PreCommit
8
8
  # example of output:
9
9
  # index.css: line 4, col 4, error - Expected indentation of 2 spaces (indentation)
10
10
 
11
- MESSAGE_REGEX = /^(?<file>.+):\D*(?<line>\d).*$/
11
+ MESSAGE_REGEX = /^(?<file>.+):\D*(?<line>\d+).*$/
12
12
 
13
13
  def run
14
14
  result = execute(command, args: applicable_files)
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module Overcommit
5
- VERSION = '0.48.0'
5
+ VERSION = '0.48.1'
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.48.0
4
+ version: 0.48.1
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-05-03 00:00:00.000000000 Z
11
+ date: 2019-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: childprocess