Mercurial > public > mercurial-scm > hg
comparison rust/hg-core/src/dirstate_tree/status.rs @ 47346:5e12b6bfdd3e
dirstate-tree: Fix status algorithm with unreadable directory
When reading a directory fails such as because of insufficient permissions,
it should be treated as empty by status instead of skipped entirely.
Differential Revision: https://phab.mercurial-scm.org/D10823
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Fri, 28 May 2021 12:16:14 +0200 |
parents | f27f2afb15da |
children | 73ddcedeaadf |
comparison
equal
deleted
inserted
replaced
47345:710435a5c469 | 47346:5e12b6bfdd3e |
---|---|
139 directory_fs_path, | 139 directory_fs_path, |
140 is_at_repo_root, | 140 is_at_repo_root, |
141 ) { | 141 ) { |
142 entries | 142 entries |
143 } else { | 143 } else { |
144 return Ok(()); | 144 // Treat an unreadable directory (typically because of insufficient |
145 // permissions) like an empty directory. `self.read_dir` has | |
146 // already called `self.io_error` so a warning will be emitted. | |
147 Vec::new() | |
145 }; | 148 }; |
146 | 149 |
147 // `merge_join_by` requires both its input iterators to be sorted: | 150 // `merge_join_by` requires both its input iterators to be sorted: |
148 | 151 |
149 let dirstate_nodes = dirstate_nodes.sorted(); | 152 let dirstate_nodes = dirstate_nodes.sorted(); |