aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-07-27 15:40:45 +0200
committerMartin Fischer <martin@push-f.com>2022-07-27 15:42:15 +0200
commit4c036ec89cebabd4fcf068177cc668110c5a42ed (patch)
tree36248a2a68a574312b1dd30d1faaf758b952841e
parent2d9d1f7fa444204a9045f08e19af763f465af383 (diff)
refactor: use Context::branch_head
-rw-r--r--src/main.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index be38348..ab65d75 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -361,10 +361,7 @@ async fn build_response<C: Controller>(
return post_routes::build_response(origin, &params, controller, ctx, body, parts).await;
}
- let mut tree = ctx
- .repo
- .revparse_single(&ctx.branch.rev_str())
- .map(|r| r.into_commit().unwrap().tree().unwrap());
+ let mut tree = ctx.branch_head()?.tree();
if ctx.path.components().next().is_some() {
let entr = match tree.and_then(|t| t.get_path(ctx.path.as_ref())) {