Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 16, 2024

Conversation

sourcegraph-release-bot
Copy link
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)
Copy link

graphite-app bot commented May 14, 2024

(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
12 of 16 checks passed
@Chickensoupwithrice Chickensoupwithrice deleted the backport-62671-to-5.4.0 branch May 16, 2024 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.

None yet

3 participants