I want to see commits in repos with no branches

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

  • Close this issue

Summary

Gitlab won't let me browse the contents of a commit with no branches (but with other refs).

I think that's because of: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/controllers/projects/application_controller.rb#L62

This matters to us because our submodules use synthetic refs: https://github.com/twosigma/git-meta/blob/master/doc/architecture.md

Steps to reproduce

Create a new empty project (e.g. https://gitlab.com/dturner_ts/nonempty. From a local repo, git push HEAD:refs/morx/fleem. Visit:

dturner_ts/nonempty@271f375e

Get redirected back to https://gitlab.com/dturner_ts/nonempty instead of seeing my commit

By contrast, I also pushed the same commit to refs/morx/fleem on a repo that had branches:

dturner_ts/gitlab-ce@271f375e

That link works.

Example Project

dturner_ts/nonempty@271f375e

What is the current bug behavior?

I get redirected back to https://gitlab.com/dturner_ts/nonempty

What is the expected correct behavior?

I see my commit.

Output of checks

This bug happens on GitLab.com

Possible fixes

Just remove e.g. https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/controllers/projects/blob_controller.rb#L11

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