minad-git 1.1.3 → 1.1.5

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.
Files changed (3) hide show
  1. data/lib/git.rb +1 -1
  2. data/lib/git/lib.rb +12 -18
  3. metadata +1 -1
data/lib/git.rb CHANGED
@@ -40,7 +40,7 @@ require 'git/stash'
40
40
  # License:: MIT License
41
41
  module Git
42
42
 
43
- VERSION = '1.1.3'
43
+ VERSION = '1.1.5'
44
44
 
45
45
  # open a bare repository
46
46
  #
data/lib/git/lib.rb CHANGED
@@ -169,9 +169,10 @@ module Git
169
169
  data = {'blob' => {}, 'tree' => {}}
170
170
 
171
171
  command_lines('ls-tree', sha).each do |line|
172
- (info, filenm) = line.split("\t")
173
- (mode, type, sha) = info.split
174
- data[type][filenm] = {:mode => mode, :sha => sha}
172
+ info, file = line.split("\t")
173
+ mode, type, sha = info.split
174
+ file = eval(file) if file =~ /^\".*\"$/ # FIXME: This takes care of quoted strings returned from git
175
+ data[type][file] = {:mode => mode, :sha => sha}
175
176
  end
176
177
 
177
178
  data
@@ -256,7 +257,7 @@ module Git
256
257
  hsh = {:total => {:insertions => 0, :deletions => 0, :lines => 0, :files => 0}, :files => {}}
257
258
 
258
259
  command_lines('diff', diff_opts).each do |file|
259
- (insertions, deletions, filename) = file.split("\t")
260
+ insertions, deletions, filename = file.split("\t")
260
261
  hsh[:total][:insertions] += insertions.to_i
261
262
  hsh[:total][:deletions] += deletions.to_i
262
263
  hsh[:total][:lines] = (hsh[:total][:deletions] + hsh[:total][:insertions])
@@ -271,8 +272,8 @@ module Git
271
272
  def diff_files
272
273
  hsh = {}
273
274
  command_lines('diff-files').each do |line|
274
- (info, file) = line.split("\t")
275
- (mode_src, mode_dest, sha_src, sha_dest, type) = info.split
275
+ info, file = line.split("\t")
276
+ mode_src, mode_dest, sha_src, sha_dest, type = info.split
276
277
  hsh[file] = {:path => file, :mode_file => mode_src.to_s[1, 7], :mode_index => mode_dest,
277
278
  :sha_file => sha_src, :sha_index => sha_dest, :type => type}
278
279
  end
@@ -283,8 +284,8 @@ module Git
283
284
  def diff_index(treeish)
284
285
  hsh = {}
285
286
  command_lines('diff-index', treeish).each do |line|
286
- (info, file) = line.split("\t")
287
- (mode_src, mode_dest, sha_src, sha_dest, type) = info.split
287
+ info, file = line.split("\t")
288
+ mode_src, mode_dest, sha_src, sha_dest, type = info.split
288
289
  hsh[file] = {:path => file, :mode_repo => mode_src.to_s[1, 7], :mode_index => mode_dest,
289
290
  :sha_repo => sha_src, :sha_index => sha_dest, :type => type}
290
291
  end
@@ -294,9 +295,9 @@ module Git
294
295
  def ls_files
295
296
  hsh = {}
296
297
  command_lines('ls-files', '--stage').each do |line|
297
- (info, file) = line.split("\t")
298
- (mode, sha, stage) = info.split
299
- file = eval(file) if file =~ /^\".*\"$/ # This takes care of quoted strings returned from git
298
+ info, file = line.split("\t")
299
+ mode, sha, stage = info.split
300
+ file = eval(file) if file =~ /^\".*\"$/ # FIXME: This takes care of quoted strings returned from git
300
301
  hsh[file] = {:path => file, :mode_index => mode, :sha_index => sha, :stage => stage}
301
302
  end
302
303
  hsh
@@ -318,19 +319,12 @@ module Git
318
319
 
319
320
  def config_get(name)
320
321
  config_list[name]
321
- #command('config', ['--get', name])
322
322
  end
323
323
 
324
324
  def config_list
325
325
  config = {}
326
326
  config.merge!(parse_config('~/.gitconfig'))
327
327
  config.merge!(parse_config(File.join(@git_dir, 'config')))
328
- #hsh = {}
329
- #command_lines('config', ['--list']).each do |line|
330
- # (key, value) = line.split('=')
331
- # hsh[key] = value
332
- #end
333
- #hsh
334
328
  end
335
329
 
336
330
  def parse_config(file)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minad-git
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chacon