GitLab Pages: Simplify way of checking the latest commit of a branch in UpdatePagesService

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

From https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18099/diffs#note_65867480:

The only thing we're interested in here is the SHA of the tip of the branch.

Surely, I thought to myself. Surely there's a way to get that by parsing only the refs?

Closest I found was project.repository.rev_list(including: [build.ref]).split("\n").first, but I'm not convinced it's > the same thing. WDYT?

It looks to me that git rev-list still opens pack files to traverse the commits. We might be able to resolve this via git log -n 1 <branch name>.

/cc: @ayufan, @nick.thomas

Edited Aug 25, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading