mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 19:44:45 +00:00
avoid comparing symlink pointing to themselves (#133)
This commit is contained in:
@@ -191,6 +191,17 @@ def cmd_compare(o, tmp):
|
||||
same = False
|
||||
continue
|
||||
src = tmpsrc
|
||||
|
||||
# is a symlink pointing to itself
|
||||
asrc = os.path.join(o.dotpath, os.path.expanduser(src))
|
||||
adst = os.path.expanduser(dotfile.dst)
|
||||
if os.path.samefile(asrc, adst):
|
||||
if o.debug:
|
||||
line = '=> compare {}: diffing with \"{}\"'
|
||||
LOG.dbg(line.format(dotfile.key, dotfile.dst))
|
||||
LOG.dbg('points to itself')
|
||||
return True
|
||||
|
||||
# install dotfile to temporary dir
|
||||
ret, insttmp = inst.install_to_temp(t, tmp, src, dotfile.dst)
|
||||
if not ret:
|
||||
|
||||
Reference in New Issue
Block a user