gollum-rugged_adapter 0.99 → 0.99.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rugged_adapter/git_layer_rugged.rb +14 -5
- data/lib/rugged_adapter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62f2f0d6560dcb5d317b61df375d139cb190b16c9af3ba3c1f54b03fa3cfc141
|
4
|
+
data.tar.gz: a7670168ff8073d746be2595ce29cb8adf6f5b41c732e0c0c1c884542a8504ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ffdbf17ec358fc35cb5b54e7566826c507d4405ba657e009bb77391997d1a58dc650360232f565889a6f470215bd112198a4d6357ffa1e03b37b253415bb961
|
7
|
+
data.tar.gz: e7b85277ae334912092be5296dd0da660a7ba02ad1f4ad92a5f22c9f5c9fa5859a164d5af0573ba96f56a065cd13fd6c20e0ba99e7bf2cd77dd83ad80f0aed43
|
@@ -16,6 +16,7 @@ module Gollum
|
|
16
16
|
|
17
17
|
DEFAULT_MIME_TYPE = "text/plain"
|
18
18
|
class NoSuchShaFound < StandardError; end
|
19
|
+
class PathApplyError < StandardError; end
|
19
20
|
|
20
21
|
class Actor
|
21
22
|
|
@@ -196,7 +197,7 @@ module Gollum
|
|
196
197
|
diff = @repo.diff(sha2, sha1, {:paths => [path]}).first.diff
|
197
198
|
begin
|
198
199
|
result = @repo.apply(diff, {:location => :index, :path => path})
|
199
|
-
rescue RuntimeError
|
200
|
+
rescue RuntimeError, Rugged::PathError
|
200
201
|
return false
|
201
202
|
end
|
202
203
|
begin
|
@@ -493,9 +494,13 @@ module Gollum
|
|
493
494
|
def read_tree(id)
|
494
495
|
id = Gollum::Git::Git.new(@rugged_repo).ref_to_sha(id)
|
495
496
|
return nil if id.nil?
|
496
|
-
|
497
|
-
|
498
|
-
|
497
|
+
begin
|
498
|
+
current_tree = @rugged_repo.lookup(id)
|
499
|
+
current_tree = current_tree.tree unless current_tree.is_a?(Rugged::Tree)
|
500
|
+
@index.read_tree(current_tree)
|
501
|
+
rescue
|
502
|
+
raise Gollum::Git::NoSuchShaFound
|
503
|
+
end
|
499
504
|
@current_tree = Gollum::Git::Tree.new(current_tree)
|
500
505
|
end
|
501
506
|
|
@@ -579,7 +584,11 @@ module Gollum
|
|
579
584
|
end
|
580
585
|
|
581
586
|
def commit(id)
|
582
|
-
|
587
|
+
begin
|
588
|
+
git.commit_from_ref(id)
|
589
|
+
rescue
|
590
|
+
raise Gollum::Git::NoSuchShaFound
|
591
|
+
end
|
583
592
|
end
|
584
593
|
|
585
594
|
def commits(start = 'refs/heads/master', max_count = 10, skip = 0)
|