2
0
Эх сурвалжийг харах

extract: remove duplicate code

anything at <path> gets nuked already a few lines above, if possible.
Thomas Waldmann 8 жил өмнө
parent
commit
f1bc2076a7
1 өөрчлөгдсөн 0 нэмэгдсэн , 4 устгасан
  1. 0 4
      borg/archive.py

+ 0 - 4
borg/archive.py

@@ -403,8 +403,6 @@ Number of files: {0.stats.nfiles}'''.format(
             if b'source' in item:
                 source = os.path.join(dest, item[b'source'])
                 with backup_io():
-                    if os.path.exists(path):
-                        os.unlink(path)
                     os.link(source, path)
             else:
                 with backup_io():
@@ -438,8 +436,6 @@ Number of files: {0.stats.nfiles}'''.format(
             elif stat.S_ISLNK(mode):
                 make_parent(path)
                 source = item[b'source']
-                if os.path.exists(path):
-                    os.unlink(path)
                 try:
                     os.symlink(source, path)
                 except UnicodeEncodeError: