From ce5c90b4e574fc290bf1a000b0d6f0df71c8d2a3 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Wed, 22 Mar 2023 22:34:16 -0700 Subject: [PATCH] revset: use `Index::has_id()` for checking if a commit has been indexed This avoids another use of `IndexEntry`. --- lib/src/revset.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/revset.rs b/lib/src/revset.rs index 7ba944b21..5ae0339db 100644 --- a/lib/src/revset.rs +++ b/lib/src/revset.rs @@ -1449,7 +1449,7 @@ fn resolve_full_commit_id( let commit_id = CommitId::new(binary_commit_id); match repo.store().get_commit(&commit_id) { // Only recognize a commit if we have indexed it - Ok(_) if repo.index().entry_by_id(&commit_id).is_some() => Ok(Some(vec![commit_id])), + Ok(_) if repo.index().has_id(&commit_id) => Ok(Some(vec![commit_id])), Ok(_) | Err(BackendError::ObjectNotFound { .. }) => Ok(None), Err(err) => Err(RevsetError::StoreError(err)), }