From f1bc2076a758ef1c1ce86a8cfa302a2b42f39dac Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 1 Apr 2017 17:05:38 +0200 Subject: [PATCH] extract: remove duplicate code anything at gets nuked already a few lines above, if possible. --- borg/archive.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/borg/archive.py b/borg/archive.py index d37a1ce01..178ad94b8 100644 --- a/borg/archive.py +++ b/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: