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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9b5e759dc0448a68c2ef5b03a5da78f81ca2af18e5faa82280b2f707a83e7d4
4
- data.tar.gz: bcc46ceaab4b1bf5b5dd1d5e05ce9856a9cd6ee63219eaf85dbff7f90c87f9d4
3
+ metadata.gz: 62f2f0d6560dcb5d317b61df375d139cb190b16c9af3ba3c1f54b03fa3cfc141
4
+ data.tar.gz: a7670168ff8073d746be2595ce29cb8adf6f5b41c732e0c0c1c884542a8504ee
5
5
  SHA512:
6
- metadata.gz: 0abff79a7bdb6ea9ea54a7d6483cb7a8e2daf34d0d28f44a2a7702efe12a2d6bdaed8e59fd3969bd7aa57b5b62b281880f998c2d740cd91dc2f0ab5a9ae370c7
7
- data.tar.gz: 0b2e7ac0435588fc46a2f4777e5295a26caa370f24a1ec5a0083c5470c4668c3a64596d27112c645c39d4949acabf3cbd45e610405e93c048d5b3438b1cfa69b
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
- current_tree = @rugged_repo.lookup(id)
497
- current_tree = current_tree.tree unless current_tree.is_a?(Rugged::Tree)
498
- @index.read_tree(current_tree)
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
- git.commit_from_ref(id)
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)
@@ -1,7 +1,7 @@
1
1
  module Gollum
2
2
  module Lib
3
3
  module Git
4
- VERSION = '0.99'
4
+ VERSION = '0.99.1'
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-rugged_adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.99'
4
+ version: 0.99.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bart Kamphorst, Dawa Ometto