utils.py: safe_link(): Unlink only if target already exists

Unlike shutil.copyfile(), os.link() will not modify the target file if it exists already.

This improves staging performance by about 10% in a simple test (tested on top of !1184 (merged)).

Merge request reports

Loading