Show More
@@ -63,10 +63,16 b' class GitInMemoryChangeset(BaseInMemoryC' | |||
|
63 | 63 | # If found, updates parent |
|
64 | 64 | parent = self.repository._repo[dir_id] |
|
65 | 65 | ancestors.append((curdir, parent)) |
|
66 | # Now parent is deepest exising tree and we need to create subtrees | |
|
66 | # Now parent is deepest existing tree and we need to create subtrees | |
|
67 | 67 | # for dirnames (in reverse order) [this only applies for nodes from added] |
|
68 | 68 | new_trees = [] |
|
69 | blob = objects.Blob.from_string(node.content.encode(ENCODING)) | |
|
69 | ||
|
70 | if not node.is_binary: | |
|
71 | content = node.content.encode(ENCODING) | |
|
72 | else: | |
|
73 | content = node.content | |
|
74 | blob = objects.Blob.from_string(content) | |
|
75 | ||
|
70 | 76 | node_path = node.name.encode(ENCODING) |
|
71 | 77 | if dirnames: |
|
72 | 78 | # If there are trees which should be created we need to build |
@@ -44,6 +44,7 b' class InMemoryChangesetTestMixin(object)' | |||
|
44 | 44 | FileNode('foobar2', content='Foo & bar, doubled!'), |
|
45 | 45 | FileNode('foo bar with spaces', content=''), |
|
46 | 46 | FileNode('foo/bar/baz', content='Inside'), |
|
47 | FileNode('foo/bar/file.bin', content='\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00;\x00\x03\x00\xfe\xff\t\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x18\x00\x00\x00\x01\x00\x00\x00\xfe\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'), | |
|
47 | 48 | ] |
|
48 | 49 | |
|
49 | 50 | def test_add(self): |
General Comments 0
You need to be logged in to leave comments.
Login now