(ctx context.Context, f *gitdiff.File)
| 119 | } |
| 120 | |
| 121 | func (a *GraphQLApplier) applyCreate(ctx context.Context, f *gitdiff.File) error { |
| 122 | _, exists, err := a.getContent(ctx, f.NewName) |
| 123 | if err != nil { |
| 124 | return err |
| 125 | } |
| 126 | if exists { |
| 127 | return &Conflict{Type: ConflictNewFileExists, File: f.NewName} |
| 128 | } |
| 129 | |
| 130 | var b bytes.Buffer |
| 131 | if err := apply(&b, bytes.NewReader(nil), f.NewName, f); err != nil { |
| 132 | return err |
| 133 | } |
| 134 | |
| 135 | a.changes[f.NewName] = pendingChange{Content: b.Bytes()} |
| 136 | a.modeCache[f.NewName] = defaultMode |
| 137 | return nil |
| 138 | } |
| 139 | |
| 140 | func (a *GraphQLApplier) applyDelete(ctx context.Context, f *gitdiff.File) error { |
| 141 | data, exists, err := a.getContent(ctx, f.OldName) |
no test coverage detected