We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 921a299 commit 943dcefCopy full SHA for 943dcef
pkg/cmd/gist/edit/edit.go
@@ -174,6 +174,10 @@ func editRun(opts *EditOptions) error {
174
}
175
176
177
+ if len(filesToUpdate) == 0 {
178
+ return nil
179
+ }
180
+
181
err = updateGist(client, ghinstance.OverridableDefault(), gist)
182
if err != nil {
183
return err
pkg/cmd/gist/edit/edit_test.go
@@ -177,6 +177,19 @@ func Test_editRun(t *testing.T) {
},
+ {
+ name: "not change",
+ gist: &shared.Gist{
+ ID: "1234",
184
+ Files: map[string]*shared.GistFile{
185
+ "cicada.txt": {
186
+ Filename: "cicada.txt",
187
+ Content: "new file content",
188
+ Type: "text/plain",
189
+ },
190
191
192
193
194
195
for _, tt := range tests {
0 commit comments