Remove a duplicate _push() from the "first_root" code. This could cause
the creation of a tree that was immediately _pop()ped by the "finish the
current sub-tree" code, and then reintroduced (as a duplicate parent
entry) by the "start a new sub-tree" code.
Instead, just wait for the "start a new sub-tree" code to call the
relevant _push().
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
# ...].
if first_root == None:
- dir_name, fs_path = dirp[0]
first_root = dirp[0]
- # Not indexed, so just grab the FS metadata or use empty metadata.
- try:
- meta = metadata.from_path(fs_path) if fs_path else metadata.Metadata()
- except (OSError, IOError), e:
- add_error(e)
- lastskip_name = dir_name
- else:
- _push(dir_name, meta)
elif first_root != dirp[0]:
root_collision = True