From 872a61270e251b60e9f34abb22cdbfa6925b3484 Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Fri, 25 Sep 2026 05:20:55 +0900 Subject: [PATCH] gitmirror-xrpc: peel refs on `git.listCommits` e.g. annotated tags Signed-off-by: Seongmin Lee --- gitmirror/crates/gitmirror-xrpc/src/routes/git.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gitmirror/crates/gitmirror-xrpc/src/routes/git.rs b/gitmirror/crates/gitmirror-xrpc/src/routes/git.rs index 756e1842..14dd2ad6 100644 --- a/gitmirror/crates/gitmirror-xrpc/src/routes/git.rs +++ b/gitmirror/crates/gitmirror-xrpc/src/routes/git.rs @@ -614,14 +614,17 @@ fn commit_log_walk<'repo>( } } } else { + let peel = |id| -> anyhow::Result { + Ok(repo.find_object(id)?.peel_to_commit()?.id) + }; for range in ranges { let revspec = repo.rev_parse(range.as_bstr())?; let spec = revspec.detach(); match spec { - RevSpec::Include(id) => tips.push(id), + RevSpec::Include(id) => tips.push(peel(id)?), RevSpec::Range { from, to } => { - tips.push(to); - hidden.push(from); + tips.push(peel(to)?); + hidden.push(peel(from)?); } _ => { anyhow::bail!("The spec isn't currently supported: {spec:?}") -- 2.54.0