Commit 472d099a authored by Kai Willadsen's avatar Kai Willadsen

dirdiff: Fix support for missing folders in folder comparison

parent c9752fe5
......@@ -720,7 +720,7 @@ class DirDiff(Gtk.VBox, tree.TreeviewCommon, MeldDoc):
# the time we get this far. This is a fallback, and may be wrong!
locations = list(locations)
for i, l in enumerate(locations):
if not isinstance(l, str):
if l and not isinstance(l, str):
locations[i] = l.decode(sys.getfilesystemencoding())
locations = [os.path.abspath(l) if l else '' for l in locations]
self.current_path = None
......@@ -1469,7 +1469,7 @@ class DirDiff(Gtk.VBox, tree.TreeviewCommon, MeldDoc):
]
existing_times = [s.st_mtime for s in stats if s]
newest_time = max(existing_times)
newest_time = max(existing_times) if existing_times else 0
if existing_times.count(newest_time) == len(existing_times):
# If all actually-present files have the same mtime, don't
# pretend that any are "newer", and do the same if e.g.,
......
......@@ -540,7 +540,7 @@ class MeldWindow(Gtk.ApplicationWindow):
return doc
def append_dirdiff(self, gfiles, auto_compare=False):
dirs = [d.get_path() for d in gfiles if d]
dirs = [d.get_path() if d else None for d in gfiles]
assert len(dirs) in (1, 2, 3)
doc = DirDiff(len(dirs))
self._append_page(doc, "folder")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment