gitrb 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/gitrb.gemspec +1 -1
- data/lib/gitrb/blob.rb +1 -0
- data/lib/gitrb/repository.rb +3 -1
- data/lib/gitrb/tree.rb +4 -2
- metadata +3 -3
data/gitrb.gemspec
CHANGED
data/lib/gitrb/blob.rb
CHANGED
data/lib/gitrb/repository.rb
CHANGED
@@ -185,7 +185,7 @@ module Gitrb
|
|
185
185
|
#
|
186
186
|
# Returns a tree, blob, commit or tag object.
|
187
187
|
def get(id)
|
188
|
-
raise ArgumentError, '
|
188
|
+
raise ArgumentError, 'Invalid id given' if !(String === id)
|
189
189
|
|
190
190
|
if id =~ SHA_PATTERN
|
191
191
|
raise ArgumentError, "Sha too short: #{id}" if id.length < 5
|
@@ -202,6 +202,8 @@ module Gitrb
|
|
202
202
|
trie = @objects.find(id)
|
203
203
|
raise NotFound, "Sha is ambiguous: #{id}" if trie.size > 1
|
204
204
|
return trie.value if !trie.empty?
|
205
|
+
else
|
206
|
+
raise ArgumentError, "Invalid id given: #{id}"
|
205
207
|
end
|
206
208
|
|
207
209
|
@logger.debug "gitrb: Loading #{id}"
|
data/lib/gitrb/tree.rb
CHANGED
@@ -64,6 +64,7 @@ module Gitrb
|
|
64
64
|
|
65
65
|
# Write an entry on specified path.
|
66
66
|
def []=(path, entry)
|
67
|
+
raise ArgumentError if !entry
|
67
68
|
path = normalize_path(path)
|
68
69
|
if path.empty?
|
69
70
|
raise 'Empty path'
|
@@ -89,8 +90,9 @@ module Gitrb
|
|
89
90
|
if path.empty?
|
90
91
|
raise 'Empty path'
|
91
92
|
elsif path.size == 1
|
92
|
-
|
93
|
-
@
|
93
|
+
child = @children.delete(path.first)
|
94
|
+
@modified = true if child
|
95
|
+
child
|
94
96
|
else
|
95
97
|
tree = @children[path.first]
|
96
98
|
raise 'Not a tree' if tree.type != :tree
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 8
|
9
|
+
version: 0.1.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Daniel Mendler
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-08-
|
17
|
+
date: 2010-08-22 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|