/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to object_store.py

Avoid writing empty trees.

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
                return self._idmap.lookup_tree(entry.file_id, inv.revision_id), None
137
137
            except KeyError:
138
138
                ret = self._get_ie_object(entry, inv, unusual_modes)
139
 
                self._idmap.add_entry(ret.id, "tree", (entry.file_id, inv.revision_id))
140
 
                return ret.id, ret
 
139
                if ret is None:
 
140
                    hexsha = None
 
141
                else:
 
142
                    hexsha = ret.id
 
143
                self._idmap.add_entry(hexsha, "tree", (entry.file_id, inv.revision_id))
 
144
                return hexsha, ret
141
145
        else:
142
146
            try:
143
147
                return self._idmap.lookup_blob(entry.file_id, entry.revision), None