ok/jj
1
0
Fork 0
forked from mirrors/jj

revset: use Index::has_id() for checking if a commit has been indexed

This avoids another use of `IndexEntry`.
This commit is contained in:
Martin von Zweigbergk 2023-03-22 22:34:16 -07:00 committed by Martin von Zweigbergk
parent baea314fc0
commit ce5c90b4e5

View file

@ -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)),
}