gollum-grit_adapter 1.0.1 → 2.0.0

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: 686ddaf10e33923c3255a114279b9969b601fa2a
4
- data.tar.gz: 6067e9acb38ef96d169939447ead8715d88340fd
3
+ metadata.gz: 9adb93ad3d79476866829ba71c2058625efa0ac2
4
+ data.tar.gz: 5f24466bcf0eedb285c82731f3dfba95468dc5db
5
5
  SHA512:
6
- metadata.gz: 51992b0620c12c45aaf3c586f798c64ac80ac805156bbe197311c892551f555afd07869bbb31ebec1a303bfe6f3940cc6990649b0b14f4231f4a9cfcb1b90218
7
- data.tar.gz: 553545f141fc16dca610aeb82eaa62887227d7ff380f765ad3554ea28a8cfc374a7df36ad4eb89f8c9e50b9a136ee316a0272144d9d736142417117d66f4869a
6
+ metadata.gz: 2ab2a46a63cfda360918101de63b68a00f096afe4a063b9940d6b45840854e9be5f7063a5a1ad6e63511a9f024c13586623547c1e94f64a63ae8f53661600d14
7
+ data.tar.gz: 14367d63aa13bd8d3c6a2d3bc0e4275f2f67b42bc41b7d30c9e6e064d14da3e28fe4d3f69f5d30984d8a8a2a803ea4cfd5f08f6d359a0f8eb19bc659d9dfe6a4
@@ -167,6 +167,12 @@ module Gollum
167
167
  rescue Grit::GitRuby::Repository::NoSuchShaFound
168
168
  raise Gollum::Git::NoSuchShaFound
169
169
  end
170
+
171
+ def revert(path, sha1, sha2, ref)
172
+ patch = path ?
173
+ repo.diff(sha2, sha1, path).first.diff : repo.diff(sha2, sha1).map { |d| d.diff }.join("\n")
174
+ @git.apply_patch({}, ref, patch)
175
+ end
170
176
 
171
177
  def ls_files(query, options = {})
172
178
  ref = options[:ref] ? options[:ref] : "HEAD"
@@ -184,10 +190,6 @@ module Gollum
184
190
  @git.native(:ls_tree, options, *args, &block)
185
191
  end
186
192
 
187
- def apply_patch(head_sha=nil, patch=nil)
188
- @git.apply_patch({}, head_sha, patch)
189
- end
190
-
191
193
  # @repo.git.cat_file({:p => true}, sha)
192
194
  def cat_file(options, sha)
193
195
  @git.cat_file(options, sha)
@@ -1,7 +1,7 @@
1
1
  module Gollum
2
2
  module Lib
3
3
  module Git
4
- VERSION = '1.0.1'
4
+ VERSION = '2.0.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum-grit_adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bart Kamphorst, Dawa Ometto