Commit 04340139 authored by David O'Regan's avatar David O'Regan

Fix Web IDE renaming empty content

In the Web IDE when you rename a file
you loose chnages made inside that
file on commit. We fix that by
removing a null condition from the
commit payload.

Changelog: fixed
parent 314a36ab
......@@ -117,7 +117,7 @@ export const createCommitPayload = ({
action: commitActionForFile(f),
file_path: f.path,
previous_path: f.prevPath || undefined,
content: f.prevPath && !f.changed ? null : content || undefined,
content: content || undefined,
encoding: isBlob ? 'base64' : 'text',
last_commit_id: newBranch || f.deleted || f.prevPath ? undefined : f.lastCommitSha,
};
......
......@@ -94,7 +94,7 @@ describe('Multi-file store utils', () => {
{
action: commitActionTypes.move,
file_path: 'renamedFile',
content: null,
content: undefined,
encoding: 'text',
last_commit_id: undefined,
previous_path: 'prevPath',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment