only sends content if it exists

This commit is contained in:
Phil Hughes 2018-08-02 12:09:27 +01:00
parent 3d5f8fb5e8
commit 6ce90bfb9f
No known key found for this signature in database
GPG key ID: 32245528C52E0F9F

View file

@ -137,7 +137,7 @@ export const createCommitPayload = ({ branch, getters, newBranch, state, rootSta
action: commitActionForFile(f), action: commitActionForFile(f),
file_path: f.path, file_path: f.path,
previous_path: f.prevPath === '' ? undefined : f.prevPath, previous_path: f.prevPath === '' ? undefined : f.prevPath,
content: f.content, content: f.content || undefined,
encoding: f.base64 ? 'base64' : 'text', encoding: f.base64 ? 'base64' : 'text',
last_commit_id: newBranch || f.deleted || f.prevPath ? undefined : f.lastCommitSha, last_commit_id: newBranch || f.deleted || f.prevPath ? undefined : f.lastCommitSha,
})), })),