From 0149e7b3118602c3eecaeee85a6f244316325987 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sat, 20 May 2023 17:32:49 +0900 Subject: [PATCH] git_backend: generate change id from git2::Commit object I'm going to extract a helper function that converts git2::Commit to backend::Commit struct, and the commit id can also be obtained from the git2::Commit object. --- lib/src/git_backend.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/git_backend.rs b/lib/src/git_backend.rs index 0e85380fd..e56f6494d 100644 --- a/lib/src/git_backend.rs +++ b/lib/src/git_backend.rs @@ -463,7 +463,7 @@ impl Backend for GitBackend { // leading 16 bytes to address that. We also reverse the bits to make it less // likely that users depend on any relationship between the two ids. let change_id = ChangeId::new( - id.as_bytes()[4..HASH_LENGTH] + commit.id().as_bytes()[4..HASH_LENGTH] .iter() .rev() .map(|b| b.reverse_bits())