rjgit 5.4.0.0 → 5.4.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bef2d8553013e27026bee97152a3b9fffc0797dd46383908b11678d430880412
4
- data.tar.gz: d53586349ad1b281e17d49b65f8e90597494e2b2909f6666ee5ffc0939bb3ecd
3
+ metadata.gz: 39f8a936a67ceeab8a72588eb9cbe80b204ff8ecfa2b8b9b62692e87947d33d6
4
+ data.tar.gz: 621f246226c7347df618fdc412694227f92ac0ac9c4431e292a509ea2f71480f
5
5
  SHA512:
6
- metadata.gz: cb1194385611d3b20d3a9159c2c1e06d78fa50ed1520d2245493f0c5ac3a9eba9597fdadde33279c1ce11c05eba850a85891601c6ae50b73346e7fa7998da685
7
- data.tar.gz: 4ff389fa5a097cd5e02a08259ff8ad5c36aa9f9c615a41bbc6c9dbfe937689c895a76a7354d43095fd1d5ad06d042e03d45d8a2f0acb4316e6763fee3ee4e8de
6
+ metadata.gz: 2e3136e29b1eaa3fcecc91ef654b73406a4271d5d26b2fed9ad4aa63c0af3e79cfc13f78eb7123524054c9d56d498d59576d9057847b168a4988ee7133a7b361
7
+ data.tar.gz: 991d9fa265d23da1159cb8137aca135995b04cc56d3060bf0babb136168d00cff827cb73cc18f52c500d411254437603a7067e013e6e7e8287daa0dbfb86f2a4
@@ -40,9 +40,11 @@ module RJGit
40
40
  df = DiffFormatter.new(DisabledOutputStream::INSTANCE)
41
41
  df.set_repository(@jrepo)
42
42
  df.set_context(0)
43
+ df.set_detect_renames(true)
43
44
  parent_commit = @jcommit.parent_count > 0 ? @jcommit.get_parents[0] : nil
44
45
  entries = df.scan(parent_commit, @jcommit)
45
- results = {}
46
+
47
+ results = []
46
48
  total_del = 0
47
49
  total_ins = 0
48
50
  entries.each do |entry|
@@ -57,9 +59,19 @@ module RJGit
57
59
  end
58
60
  total_del += del
59
61
  total_ins += ins
60
- results[file.getNewPath] = [ins, del, ins + del]
62
+ results << {
63
+ :new_file => file.getNewPath,
64
+ :old_file => file.getOldPath,
65
+ :new_additions => ins,
66
+ :new_deletions => del,
67
+ :changes => ins + del
68
+ }
61
69
  end
62
- return total_ins, total_del, results
70
+ return {
71
+ :total_additions => total_ins,
72
+ :total_deletions => total_del,
73
+ :files => results
74
+ }
63
75
  end
64
76
 
65
77
  def diff(options = {})
@@ -95,7 +107,7 @@ module RJGit
95
107
  walk = RevWalk.new(repository)
96
108
  objhead = repository.resolve(Constants::HEAD)
97
109
  return Commit.new(repository, walk.parseCommit(objhead))
98
- rescue NativeException => e
110
+ rescue java.lang.NullPointerException => e
99
111
  return nil
100
112
  end
101
113
  end
@@ -110,7 +122,7 @@ module RJGit
110
122
  walk.mark_start(root)
111
123
  commits = walk.map { |commit| Commit.new(repository, commit) }
112
124
  return commits.first(options[:limit])
113
- rescue NativeException => e
125
+ rescue java.lang.NullPointerException => e
114
126
  return Array.new
115
127
  end
116
128
  end
data/lib/git.rb CHANGED
@@ -267,7 +267,8 @@ module RJGit
267
267
 
268
268
  def checkout(branch_name = "master", options = {})
269
269
  checkout_command = @jgit.checkout.set_name(branch_name)
270
- checkout_command.set_start_point(options[:commit])
270
+ # call :setStartPoint directly to avoid ambiguity warning
271
+ checkout_command.java_send :setStartPoint, [RevCommit], options[:commit]
271
272
  options[:paths].each {|path| checkout_command.add_path(path)} if options[:paths]
272
273
  checkout_command.set_create_branch(true) if options[:create]
273
274
  checkout_command.set_force(true) if options[:force]
@@ -376,8 +377,8 @@ module RJGit
376
377
  fetch_command.set_thin(true) if options[:thin]
377
378
  fetch_command.set_check_fetched_objects(true) if options[:check_fetched_objects]
378
379
  fetch_command.set_remove_deleted_refs(true) if options[:remove_deleted_refs]
379
- fetch_command.set_ref_specs(RefSpec.new(options[:refspecs])) if options[:refspecs]
380
380
  fetch_command.set_remote(remote) if remote
381
+ fetch_command.set_ref_specs(options[:refspecs]) if options[:refspecs]
381
382
  self.class.set_command_transport(fetch_command, remote, options)
382
383
  fetch_command.call
383
384
  end
@@ -1,3 +1,3 @@
1
1
  module RJGit
2
- VERSION = "5.4.0.0"
2
+ VERSION = "5.4.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rjgit
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.0.0
4
+ version: 5.4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maarten Engelen
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2019-08-21 00:00:00.000000000 Z
15
+ date: 2019-09-17 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  requirement: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ files:
49
49
  - lib/java/jars/bcpkix-jdk15on-161.jar
50
50
  - lib/java/jars/bcprov-jdk15on-161.jar
51
51
  - lib/java/jars/jsch-0.1.54.jar
52
- - lib/java/jars/org.eclipse.jgit-5.4.0.201906121030-r.jar
52
+ - lib/java/jars/org.eclipse.jgit-5.4.2.201908231537-r.jar
53
53
  - lib/java/jars/slf4j-api-1.7.2.jar
54
54
  - lib/java/jars/slf4j-simple-1.7.12.jar
55
55
  - lib/repo.rb