浏览代码

Merge pull request #1614 from ThomasWaldmann/trivial-changes

trivial code optimization
TW 8 年之前
父节点
当前提交
eac439a65f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      borg/archive.py

+ 1 - 1
borg/archive.py

@@ -642,7 +642,7 @@ Number of files: {0.stats.nfiles}'''.format(
         # Is it a hard link?
         # Is it a hard link?
         if st.st_nlink > 1:
         if st.st_nlink > 1:
             source = self.hard_links.get((st.st_ino, st.st_dev))
             source = self.hard_links.get((st.st_ino, st.st_dev))
-            if (st.st_ino, st.st_dev) in self.hard_links:
+            if source is not None:
                 item = self.stat_attrs(st, path)
                 item = self.stat_attrs(st, path)
                 item.update({b'path': safe_path, b'source': source})
                 item.update({b'path': safe_path, b'source': source})
                 self.add_item(item)
                 self.add_item(item)