We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c98c435 commit 42238dcCopy full SHA for 42238dc
1 file changed
pkg/cmd/gist/edit/edit.go
@@ -260,14 +260,17 @@ func editRun(opts *EditOptions) error {
260
}
261
262
// If the file is truncated, fetch the full content
263
+ // but only if it hasn't already been edited in this session
264
file := gist.Files[filename]
265
if file.Truncated {
- fullContent, err := shared.GetRawGistFile(client, file.RawURL)
266
- if err != nil {
267
- return err
268
- }
+ if _, alreadyEdited := filesToUpdate[filename]; !alreadyEdited {
+ fullContent, err := shared.GetRawGistFile(client, file.RawURL)
+ if err != nil {
269
+ return err
270
+ }
271
- gistFile.Content = fullContent
272
+ gistFile.Content = fullContent
273
274
275
276
var text string
0 commit comments