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 +4 -4
- data/lib/grit_adapter/git_layer_grit.rb +6 -4
- data/lib/grit_adapter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9adb93ad3d79476866829ba71c2058625efa0ac2
|
4
|
+
data.tar.gz: 5f24466bcf0eedb285c82731f3dfba95468dc5db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
data/lib/grit_adapter/version.rb
CHANGED