Remove dead code
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 4 Jul 2016 09:48:28 +0000 (11:48 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 4 Jul 2016 10:18:46 +0000 (12:18 +0200)
cur_index is always >= 1 in this code path

deltatar/deltatar.py

index 0a05694..b258cf6 100644 (file)
@@ -1495,20 +1495,9 @@ class RestoreHelper(object):
             data = self._data[cur_index]
             d, l_no, dpath = self.find_path_in_index(data, upath)
             if not d:
-                # file not found, so it's not in the index, so it must be
-                # removed
-                if cur_index == 0:
-                    self.delete(path)
-
-                    # now we restore parent_directory mtime
-                    os.utime(parent_dir, (parent_dir_mtime, parent_dir_mtime))
-                    return
-                # this means that the path was found in the first index as listed
-                # not in a previous one, so something wrong happened.
-                else:
-                    self._deltatar.logger.warn('Error restoring file %s from '
-                        'index, not found in index %s' % (path, data['path']))
-                    return
+                self._deltatar.logger.warn('Error restoring file %s from '
+                    'index, not found in index %s' % (path, data['path']))
+                return
 
             if d.get('path', '').startswith('delete://'):
                 self._deltatar.logger.warn(('Strange thing happened, file '