Mercurial > hg
comparison rust/hg-core/src/dirstate/status.rs @ 44748:a467416c493c stable
rust-status: check for '.hg' regardless of file type (issue6300)
'.hg' would show up in `hg status` if were a symlink.
Differential Revision: https://phab.mercurial-scm.org/D8461
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Thu, 23 Apr 2020 09:59:38 +0200 |
parents | d8b703b8bf70 |
children | dc60ba32d43b |
comparison
equal
deleted
inserted
replaced
44747:d8b703b8bf70 | 44748:a467416c493c |
---|---|
321 dir_entry: DirEntry, | 321 dir_entry: DirEntry, |
322 ) -> IoResult<()> { | 322 ) -> IoResult<()> { |
323 let file_type = dir_entry.file_type()?; | 323 let file_type = dir_entry.file_type()?; |
324 let entry_option = dmap.get(&filename); | 324 let entry_option = dmap.get(&filename); |
325 | 325 |
326 if filename.as_bytes() == b".hg" { | |
327 // Could be a directory or a symlink | |
328 return Ok(()); | |
329 } | |
330 | |
326 if file_type.is_dir() { | 331 if file_type.is_dir() { |
327 handle_traversed_dir( | 332 handle_traversed_dir( |
328 scope, | 333 scope, |
329 files_sender, | 334 files_sender, |
330 matcher, | 335 matcher, |
444 ignore_fn: &IgnoreFnType, | 449 ignore_fn: &IgnoreFnType, |
445 dir_ignore_fn: &IgnoreFnType, | 450 dir_ignore_fn: &IgnoreFnType, |
446 options: StatusOptions, | 451 options: StatusOptions, |
447 ) -> IoResult<()> { | 452 ) -> IoResult<()> { |
448 let directory = directory.as_ref(); | 453 let directory = directory.as_ref(); |
449 if directory.as_bytes() == b".hg" { | 454 |
450 return Ok(()); | |
451 } | |
452 let visit_entries = match matcher.visit_children_set(directory) { | 455 let visit_entries = match matcher.visit_children_set(directory) { |
453 VisitChildrenSet::Empty => return Ok(()), | 456 VisitChildrenSet::Empty => return Ok(()), |
454 VisitChildrenSet::This | VisitChildrenSet::Recursive => None, | 457 VisitChildrenSet::This | VisitChildrenSet::Recursive => None, |
455 VisitChildrenSet::Set(set) => Some(set), | 458 VisitChildrenSet::Set(set) => Some(set), |
456 }; | 459 }; |