ref:b25dc95dea05c56775bb02adb63a6f908dba9b67

fix: handle annotated tag objects in upload-pack reachable collection

collect_reachable_object was missing a %Tag{} clause, causing annotated tag clones to crash with a CaseClauseError. Include the tag object and recurse into its target. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SHA: b25dc95dea05c56775bb02adb63a6f908dba9b67
Author: Cole Christensen <cole.christensen@macmillan.com>
Date: 2026-02-26 08:23
Parents: 411dfdf
1 files changed +7 -1
Type
lib/ex_git_objectstore/protocol/upload_pack.ex +7 −1
@@ -25,6 +25,6 @@
"""
alias ExGitObjectstore.{Object, ObjectResolver, Ref, Repo}
alias ExGitObjectstore.Object.{Blob, Commit, Tree}
alias ExGitObjectstore.Object.{Blob, Commit, Tag, Tree}
alias ExGitObjectstore.Pack.Writer
alias ExGitObjectstore.Protocol.PktLine
@@ -378,6 +378,12 @@
{:ok, %Blob{content: content}} ->
{[{:blob, content, sha}], visited}
{:ok, %Tag{} = tag} ->
# Include the tag object itself, then recurse into its target
tag_data = Object.encode_content_only(tag)
{target_objs, visited} = collect_reachable(repo, tag.object, exclude_set, visited)
{[{:tag, tag_data, sha} | target_objs], visited}
{:error, _} ->
{[], visited}