mirror of https://github.com/borgbackup/borg.git
extract: remove duplicate code
anything at <path> gets nuked already a few lines above, if possible.
This commit is contained in:
parent
ff4f04e5f1
commit
f1bc2076a7
|
@ -403,8 +403,6 @@ Number of files: {0.stats.nfiles}'''.format(
|
||||||
if b'source' in item:
|
if b'source' in item:
|
||||||
source = os.path.join(dest, item[b'source'])
|
source = os.path.join(dest, item[b'source'])
|
||||||
with backup_io():
|
with backup_io():
|
||||||
if os.path.exists(path):
|
|
||||||
os.unlink(path)
|
|
||||||
os.link(source, path)
|
os.link(source, path)
|
||||||
else:
|
else:
|
||||||
with backup_io():
|
with backup_io():
|
||||||
|
@ -438,8 +436,6 @@ Number of files: {0.stats.nfiles}'''.format(
|
||||||
elif stat.S_ISLNK(mode):
|
elif stat.S_ISLNK(mode):
|
||||||
make_parent(path)
|
make_parent(path)
|
||||||
source = item[b'source']
|
source = item[b'source']
|
||||||
if os.path.exists(path):
|
|
||||||
os.unlink(path)
|
|
||||||
try:
|
try:
|
||||||
os.symlink(source, path)
|
os.symlink(source, path)
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
|
|
Loading…
Reference in New Issue