gitlab-grit 2.6.9 → 2.6.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91628dfa7d6ccd4bdf412c0c38315137910bfc89
4
- data.tar.gz: 000bd780528b454afe3eca1e92ba94ae82c13513
3
+ metadata.gz: cc0703262bb7ef4d6c8b89f043540bca37883db1
4
+ data.tar.gz: 3dbb330aa2501a0e99adcb6a3ceec5b24434f8f2
5
5
  SHA512:
6
- metadata.gz: 83b5a66fbdaa910c62f8dc31bd3f53ad8735a95b596a5f74d711b501d60cf04c1ac96dd3afbf3474b681af47abf309c4c48a7d38e5aa0d6288d33b1b6a4bb50a
7
- data.tar.gz: 109ddf8ab210e7e3b00167273324046572bfe31821a1fd86df9918697a86f58ebcb6dfe187b1a9adc005ba091b5bcc7d4701c1850ef76c77af7389ae1ad54f59
6
+ metadata.gz: b6bbe550adc711e01b2bbd0ae76d99f6de7647fcbad4614bf817fe9c48035ea32d881abae7751d77f3815e8672b6727898e0041b3821805b6501d0dd84193d31
7
+ data.tar.gz: 32bb2bf904b9948b38e2a8feaee05fc03d5f99904e43d738f0d43f696ae331ffe0b38cb3c173fa83b87abf1377e6094d4ac31ebcc12abc5a3d7a319f1ba1e8b3
data/README.md CHANGED
@@ -21,6 +21,8 @@ We patched existing grit library to use it inside GitLab
21
21
  * Fixes symlinks omission from diff
22
22
  * Added Gemfile
23
23
  * Ruby 2.0 support
24
+ * Automatically set the `--work-tree=` option for Git
25
+ * Remove `chdir:` option from Grit::Git#native
24
26
  * and much more small fixes
25
27
 
26
28
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.6.9
1
+ 2.6.10
data/lib/grit/git.rb CHANGED
@@ -93,9 +93,9 @@ module Grit
93
93
 
94
94
  attr_accessor :git_dir, :bytes_read, :work_tree
95
95
 
96
- def initialize(git_dir)
96
+ def initialize(git_dir, options={})
97
97
  self.git_dir = git_dir
98
- self.work_tree = git_dir.gsub(/\/\.git$/,'')
98
+ self.work_tree = options[:work_tree]
99
99
  self.bytes_read = 0
100
100
  end
101
101
 
@@ -320,12 +320,12 @@ module Grit
320
320
  input = options.delete(:input)
321
321
  timeout = options.delete(:timeout); timeout = true if timeout.nil?
322
322
  base = options.delete(:base); base = true if base.nil?
323
- chdir = options.delete(:chdir)
324
323
 
325
324
  # build up the git process argv
326
325
  argv = []
327
326
  argv << Git.git_binary
328
327
  argv << "--git-dir=#{git_dir}" if base
328
+ argv << "--work-tree=#{work_tree}" if work_tree
329
329
  argv << cmd.to_s.tr('_', '-')
330
330
  argv.concat(options_to_argv(options))
331
331
  argv.concat(args)
@@ -336,7 +336,6 @@ module Grit
336
336
  process =
337
337
  Child.new(env, *(argv + [{
338
338
  :input => input,
339
- :chdir => chdir,
340
339
  :timeout => (Grit::Git.git_timeout if timeout == true),
341
340
  :max => (Grit::Git.git_max_size if timeout == true)
342
341
  }]))
data/lib/grit/repo.rb CHANGED
@@ -54,7 +54,7 @@ module Grit
54
54
  raise NoSuchPathError.new(epath)
55
55
  end
56
56
 
57
- self.git = Git.new(self.path)
57
+ self.git = Git.new(self.path, work_tree: self.working_dir)
58
58
  end
59
59
 
60
60
  # Public: Initialize a git repository (create it on the filesystem). By
data/lib/grit/status.rb CHANGED
@@ -116,7 +116,7 @@ module Grit
116
116
  # compares the index and the working directory
117
117
  def diff_files
118
118
  hsh = {}
119
- @base.git.diff_files(chdir: @base.working_dir).split("\n").each do |line|
119
+ @base.git.diff_files({}).split("\n").each do |line|
120
120
  (info, file) = line.split("\t")
121
121
  (mode_src, mode_dest, sha_src, sha_dest, type) = info.split
122
122
  hsh[file] = {:path => file, :mode_file => mode_src.to_s[1, 7], :mode_index => mode_dest,
@@ -128,7 +128,7 @@ module Grit
128
128
  # compares the index and the repository
129
129
  def diff_index(treeish)
130
130
  hsh = {}
131
- @base.git.diff_index({chdir: @base.working_dir}, treeish).split("\n").each do |line|
131
+ @base.git.diff_index({}, treeish).split("\n").each do |line|
132
132
  (info, file) = line.split("\t")
133
133
  (mode_src, mode_dest, sha_src, sha_dest, type) = info.split
134
134
  hsh[file] = {:path => file, :mode_repo => mode_src.to_s[1, 7], :mode_index => mode_dest,
@@ -139,7 +139,7 @@ module Grit
139
139
 
140
140
  def ls_files
141
141
  hsh = {}
142
- lines = @base.git.ls_files({chdir: @base.working_dir, :stage => true})
142
+ lines = @base.git.ls_files({:stage => true})
143
143
  lines.split("\n").each do |line|
144
144
  (info, file) = line.split("\t")
145
145
  (mode, sha, stage) = info.split
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-grit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.9
4
+ version: 2.6.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-06-14 00:00:00.000000000 Z
13
+ date: 2014-07-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: charlock_holmes