MCPcopy Create free account
hub / github.com/cli/cli / ExportData

Method ExportData

pkg/cmd/repo/read-dir/http.go:106–116  ·  view source on GitHub ↗

ExportData implements the cmdutil exportable interface for the directory. gitSHA and id are structural and always present; the requested fields select which properties appear on each entry.

(fields []string)

Source from the content-addressed store, hash-verified

104// gitSHA and id are structural and always present; the requested fields select
105// which properties appear on each entry.
106func (d *repoDir) ExportData(fields []string) map[string]any {
107 entries := make([]any, 0, len(d.Entries))
108 for _, e := range d.Entries {
109 entries = append(entries, e.ExportData(fields))
110 }
111 return map[string]any{
112 "gitSHA": d.GitSHA,
113 "id": d.ID,
114 "entries": entries,
115 }
116}
117
118// fetchTree resolves a directory listing for dirPath at ref.
119//

Callers

nothing calls this directly

Calls 1

ExportDataMethod · 0.65

Tested by

no test coverage detected