Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

[Backport 5.4.0] gitserver(ListRefs): Fix type detection for lightweight tags#62674

Merged
Chickensoupwithrice merged 1 commit into
5.4.0from
backport-62671-to-5.4.0
May 16, 2024
Merged

[Backport 5.4.0] gitserver(ListRefs): Fix type detection for lightweight tags#62674
Chickensoupwithrice merged 1 commit into
5.4.0from
backport-62671-to-5.4.0

Conversation

@sourcegraph-release-bot

Copy link
Copy Markdown
Collaborator

In git, there exist two types of tags: Lightweight tags, those are boring old refs that live in refs/tags/ and point directly to a commit.
And then there are annotated tags, those live in refs/tags/ too, but they don't point to a commit directly, instead they point to a tag object, which then points to a commit object.
That is used to add a message to a tag.

However, we didn't detect lightweight tags correctly, so they would be reported as Type: Branch (as they point to a commit).

This PR fixes it.

Test plan:

Added tests and verified manually using gRPC UI.
Backport 335133a from #62671

In git, there exist two types of tags: Lightweight tags, those are boring old refs that live in refs/tags/ and point directly to a commit.
And then there are annotated tags, those live in refs/tags/ too, but they don't point to a commit directly, instead they point to a tag object, which then points to a commit object.
That is used to add a message to a tag.

However, we didn't detect lightweight tags correctly, so they would be reported as Type: Branch (as they point to a commit).

This PR fixes it.

Test plan:

Added tests and verified manually using gRPC UI.

(cherry picked from commit 335133a)
@graphite-app

graphite-app Bot commented May 14, 2024

Copy link
Copy Markdown

(Notifying @sourcegraph/source of a change that affects gitserver)

@graphite-app graphite-app Bot added the team/source Tickets under the purview of Source - the one Source to graph it all label May 14, 2024
@Chickensoupwithrice Chickensoupwithrice merged commit 177c601 into 5.4.0 May 16, 2024
@Chickensoupwithrice Chickensoupwithrice deleted the backport-62671-to-5.4.0 branch May 16, 2024 03:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport/bugfix Standard patches to fix bugs backported-to-5.4.0 backports cla-signed team/source Tickets under the purview of Source - the one Source to graph it all

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants