Commit 799c8edf authored by Jacob Schatz's avatar Jacob Schatz

Fixes bug when file content not used in commit.

parent 8a95648b
...@@ -14,8 +14,6 @@ const RepoCommitSection = { ...@@ -14,8 +14,6 @@ const RepoCommitSection = {
branchPaths() { branchPaths() {
let branch = Helper.getBranch(); let branch = Helper.getBranch();
return this.changedFiles.map((f) => { return this.changedFiles.map((f) => {
console.log('branch', branch)
console.log(Helper.getFilePathFromFullPath(f.url, branch))
return Helper.getFilePathFromFullPath(f.url, branch); return Helper.getFilePathFromFullPath(f.url, branch);
}); });
} }
...@@ -26,11 +24,15 @@ const RepoCommitSection = { ...@@ -26,11 +24,15 @@ const RepoCommitSection = {
// see https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions // see https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions
const branch = Helper.getBranch(); const branch = Helper.getBranch();
const commitMessage = this.commitMessage; const commitMessage = this.commitMessage;
const actions = this.branchPaths.map((f) => { this.changedFiles.map((f) => {
console.log('fffff',f.newContent)
});
return;
const actions = this.changedFiles.map((f) => {
const filePath = Helper.getFilePathFromFullPath(f.url, branch); const filePath = Helper.getFilePathFromFullPath(f.url, branch);
return { return {
action: 'update', action: 'update',
file_path: filePath, file_path: Helper.getFilePathFromFullPath(f.url, branch),
content: f.newContent, content: f.newContent,
}; };
}); });
......
...@@ -45,7 +45,6 @@ const RepoHelper = { ...@@ -45,7 +45,6 @@ const RepoHelper = {
}, },
getFilePathFromFullPath(fullPath, branch) { getFilePathFromFullPath(fullPath, branch) {
console.log(fullPath, branch)
return fullPath.split(branch)[1]; return fullPath.split(branch)[1];
}, },
......
...@@ -196,10 +196,11 @@ const RepoStore = { ...@@ -196,10 +196,11 @@ const RepoStore = {
setActiveFileContents(contents) { setActiveFileContents(contents) {
if (!RepoStore.editMode) return; if (!RepoStore.editMode) return;
const currentFile = RepoStore.openedFiles[RepoStore.activeFileIndex];
RepoStore.activeFile.newContent = contents; RepoStore.activeFile.newContent = contents;
RepoStore.activeFile.changed = RepoStore.activeFile.plain !== RepoStore.activeFile.newContent; RepoStore.activeFile.changed = RepoStore.activeFile.plain !== RepoStore.activeFile.newContent;
RepoStore.openedFiles[RepoStore.activeFileIndex].changed = RepoStore.activeFile.changed; currentFile.changed = RepoStore.activeFile.changed;
currentFile.newContent = contents;
}, },
// getters // getters
......
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