Fix: Do only check entries which are a ref
We should not try to check entries that are not refs because this will always fail. And because we fail _hard_, the execution of the command fails on the first non-ref-entry and exits the program. Not good for a filter... :-) Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
485779a176
commit
a7f2826bb9
1 changed files with 16 additions and 15 deletions
|
@ -175,10 +175,10 @@ fn list_dead(rt: &Runtime) {
|
|||
.for_each(|id| {
|
||||
match rt.store().get(id.clone()).map_err_trace_exit_unwrap() {
|
||||
Some(entry) => {
|
||||
let entry_path = entry
|
||||
.as_ref_with_hasher::<DefaultHasher>()
|
||||
.get_path(&cfg)
|
||||
.map_err_trace_exit_unwrap();
|
||||
let entry_ref = entry.as_ref_with_hasher::<DefaultHasher>();
|
||||
|
||||
if entry_ref.is_ref().map_err_trace_exit_unwrap() { // we only care if the entry is a ref
|
||||
let entry_path = entry_ref.get_path(&cfg).map_err_trace_exit_unwrap();
|
||||
|
||||
if !entry_path.exists() {
|
||||
if list_id {
|
||||
|
@ -194,6 +194,7 @@ fn list_dead(rt: &Runtime) {
|
|||
let _ = rt.report_touched(entry.get_location()).unwrap_or_exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
None => {
|
||||
error!("Does not exist: {}", id.local().display());
|
||||
|
|
Loading…
Reference in a new issue