Allow zip and tar archive uploads PUT request.

This commit is contained in:
Catherine
2025-09-20 07:05:19 +00:00
parent 95814dd3f3
commit 15b2f1ea39
7 changed files with 297 additions and 87 deletions

View File

@@ -62,12 +62,13 @@ func FetchRepository(ctx context.Context, repoURL string, branch string) (*Manif
defer walker.Close()
manifest := Manifest{
RepoUrl: proto.String(repoURL),
Branch: proto.String(branch),
Commit: proto.String(ref.Hash().String()),
Contents: make(map[string]*Entry),
RepoUrl: proto.String(repoURL),
Branch: proto.String(branch),
Commit: proto.String(ref.Hash().String()),
Contents: map[string]*Entry{
"": {Type: Type_Directory.Enum()},
},
}
manifest.Contents[""] = &Entry{Type: Type_Directory.Enum()}
for {
name, entry, err := walker.Next()
if err == io.EOF {
@@ -86,6 +87,7 @@ func FetchRepository(ctx context.Context, repoURL string, branch string) (*Manif
if err != nil {
return nil, fmt.Errorf("git blob open: %w", err)
}
defer reader.Close()
data, err := io.ReadAll(reader)
if err != nil {