only set filesystem metadata if :target != source

fixing a bug in the implementation of #3073 which caused
metadata to be set in all cases.