From bf272305ff2bd76b84fca08ea22c9d69aafaf7aa Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 18 Sep 2025 06:35:35 +0200 Subject: [PATCH] feat(gist): retrieve full content for truncated gist files * Added logic to fetch full content for truncated files when updating a gist. * Utilizes `shared.GetRawGistFile` to retrieve the complete content based on the `RawURL`. --- pkg/cmd/gist/edit/edit.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/cmd/gist/edit/edit.go b/pkg/cmd/gist/edit/edit.go index 9e74adf62..377bb24d8 100644 --- a/pkg/cmd/gist/edit/edit.go +++ b/pkg/cmd/gist/edit/edit.go @@ -155,6 +155,15 @@ func editRun(opts *EditOptions) error { // Transform our gist into the schema that the update endpoint expects filesToupdate := make(map[string]*gistFileToUpdate, len(gist.Files)) for filename, file := range gist.Files { + if file.Truncated { + fullContent, err := shared.GetRawGistFile(client, file.RawURL) + if err != nil { + return err + } + + file.Content = fullContent + } + filesToupdate[filename] = &gistFileToUpdate{ Content: file.Content, NewFilename: file.Filename,