gollum-grit_adapter 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of gollum-grit_adapter might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/lib/grit_adapter/git_layer_grit.rb +15 -5
- data/lib/grit_adapter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fec3b95003833b68d26ed5e70595be3e4f165eb3
|
4
|
+
data.tar.gz: 8b626ca0f6e8bd9a9c1b837514646e6378f27895
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 735d80249532575b9ebc38452121f6eb6ff1ff23432edcc48a3d4b5a109a5a56aa0b87eb3ed82652997e2ce431c9e360d64fef6821d8c29ee740640ef08689bf
|
7
|
+
data.tar.gz: a554c3322767dc792f4c1907c98cffae892ba2cea9a5fec2d8f50396b1ff583289235f003a0dfd15f0cb036d8f1fd02c0c76608d45716883e7a710a4cdde5508
|
data/Gemfile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# ~*~ encoding: utf-8 ~*~
|
2
2
|
|
3
3
|
require 'grit'
|
4
|
+
require 'ostruct'
|
4
5
|
|
5
6
|
module Gollum
|
6
7
|
|
@@ -88,6 +89,13 @@ module Gollum
|
|
88
89
|
def to_s
|
89
90
|
@commit.id
|
90
91
|
end
|
92
|
+
|
93
|
+
def stats
|
94
|
+
@stats ||= begin
|
95
|
+
grit_stats = @commit.stats
|
96
|
+
OpenStruct.new(:additions => grit_stats.additions, :deletions => grit_stats.deletions, :files => grit_stats.files, :id => id, :total => grit_stats.total)
|
97
|
+
end
|
98
|
+
end
|
91
99
|
|
92
100
|
def author
|
93
101
|
author = @commit.author
|
@@ -128,8 +136,8 @@ module Gollum
|
|
128
136
|
|
129
137
|
def grep(query, options={})
|
130
138
|
ref = options[:ref] ? options[:ref] : "HEAD"
|
131
|
-
args = [{}, '-i', '-c', query, ref, '--']
|
132
|
-
args <<
|
139
|
+
args = [{}, '-I', '-i', '-c', query, ref, '--']
|
140
|
+
args << options[:path] if options[:path]
|
133
141
|
result = @git.grep(*args).split("\n")
|
134
142
|
result.map do |line|
|
135
143
|
branch_and_name, _, count = line.rpartition(":")
|
@@ -165,8 +173,8 @@ module Gollum
|
|
165
173
|
# {:r => true, :l => true, :z => true}, sha)
|
166
174
|
end
|
167
175
|
|
168
|
-
def apply_patch(
|
169
|
-
@git.apply_patch(
|
176
|
+
def apply_patch(head_sha=nil, patch=nil)
|
177
|
+
@git.apply_patch({}, head_sha, patch)
|
170
178
|
end
|
171
179
|
|
172
180
|
# @repo.git.cat_file({:p => true}, sha)
|
@@ -186,6 +194,8 @@ module Gollum
|
|
186
194
|
end
|
187
195
|
end
|
188
196
|
|
197
|
+
private
|
198
|
+
|
189
199
|
def log(path = nil, ref = nil, options = nil, *args)
|
190
200
|
@git.native(:log, options, "--", path)
|
191
201
|
end
|
@@ -309,7 +319,7 @@ module Gollum
|
|
309
319
|
end
|
310
320
|
|
311
321
|
def log(commit = 'master', path = nil, options = {})
|
312
|
-
@repo.log(commit, path, options)
|
322
|
+
@repo.log(commit, path, options).map {|grit_commit| Gollum::Git::Commit.new(grit_commit)}
|
313
323
|
end
|
314
324
|
|
315
325
|
def lstree(sha, options = {})
|
data/lib/grit_adapter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gollum-grit_adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bart Kamphorst, Dawa Ometto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab-grit
|