1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 21:29:43 +00:00

Rename diff arguments for better clarity

This commit is contained in:
Sighery
2020-01-21 20:54:24 +01:00
parent 6adf151d83
commit 0658df361d
3 changed files with 4 additions and 4 deletions

View File

@@ -123,7 +123,7 @@ class Comparator:
def _diff(self, left, right, header=False):
"""diff using the unix tool diff"""
out = diff(left, right, raw=False,
out = diff(modified=left, original=right, raw=False,
opts=self.diffopts, debug=self.debug)
if header:
lshort = os.path.basename(left)

View File

@@ -437,7 +437,7 @@ class Installer:
if content:
tmp = utils.write_to_tmpfile(content)
src = tmp
diff = utils.diff(src, dst, raw=False)
diff = utils.diff(modified=src, original=dst, raw=False)
if tmp:
utils.remove(tmp, quiet=True)

View File

@@ -70,9 +70,9 @@ def shell(cmd, debug=False):
return ret == 0, out
def diff(src, dst, raw=True, opts='', debug=False):
def diff(original, modified, raw=True, opts='', debug=False):
"""call unix diff to compare two files"""
cmd = 'diff -r {} \"{}\" \"{}\"'.format(opts, dst, src)
cmd = 'diff -r {} \"{}\" \"{}\"'.format(opts, original, modified)
_, out = run(shlex.split(cmd), raw=raw, debug=debug)
return out